[RFC PATCH] ARM: add workaround for ambiguous C99 stdint.h types

Dave Martin Dave.Martin at arm.com
Fri Aug 9 10:30:39 EDT 2013


On Fri, Aug 09, 2013 at 04:18:30PM +0200, Ard Biesheuvel wrote:
> On 9 August 2013 16:14, Dave Martin <Dave.Martin at arm.com> wrote:
> > On Fri, Aug 09, 2013 at 09:36:42AM +0200, Ard Biesheuvel wrote:
> 
> [...]
> 
> > Somebody else might have the opposite problem to ARM, so I'm doubtful
> > about whether it's safe to do this for all arches.  The arch maintainers
> > would have to comment on that.  This looks ugly in an otherwise generic
> > header.
> >
> 
> This is actually under arch/arm so that should not be a problem. In
> fact, it's a copy of asm-generic/types.h with just the #defines added.

Duh.  Misread your patch, sorry about that.

> > (As a cosmetic thing, you can lose the #ifdefs.  #undef doesn't trigger
> > an error of the specified macro doesn't already exist.)
> >
> 
> I am aware of that, but I think it is cleaner not to pollute the
> namespace if the defines weren't there to begin with.

Ah, I see what you mean.  Yes, that makes sense.  I'd read the #ifdefs
as just being there to avoid redefinition errors.

I'll leave the thread for other people to comment, but this looks like
a reasonable thing to do for now.

Because the kernel is not a hosted C environment, we shouldn't be including
any foreign headers which care about the distinction, except for GCC's own
headers like arm_neon.h.

Cheers
---Dave



More information about the linux-arm-kernel mailing list