gcc 4.9 build warnings (was: Re: next build: 2674 warnings 1 failures (next/next-20141022))

Ard Biesheuvel ard.biesheuvel at linaro.org
Thu Oct 23 15:03:41 PDT 2014


On 23 October 2014 22:31, Arnd Bergmann <arnd at arndb.de> wrote:
> On Thursday 23 October 2014 17:12:20 Russell King - ARM Linux wrote:
>>
>> > I haven't found the code in gcc that performs the type check for
>> > printf, but I've found a comment about that code intentionally
>> > resolving the type (printing 'unsigned int') when the typedef
>> > does not match the expected type.
>>
>> If I had a copy of the GCC 4.9 source locally, I'd dig into it too and
>> try to work out what's going on.  My gut feeling is that it's a bug in
>> GCC rather than something which the kernel is doing wrong.
>>
>
> I suspect it has something to do with the way that Olof's gcc is built,
> since it doesn't happen for me using the same kernel source and gcc-4.9.1
> or 4.10-prerelease.
>
> The fact that it doesn't define __linux__ means that it must be configured
> in some other way than what I do or what I get from the distros.
>

I found a similar issue a while ago regarding uint32_t: on the bare
metal version of ARM gcc, it is typedef'ed as unsigned long, whereas
on the linux/glibc version, it is typedef'ed as unsigned int.

Patch here:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=09096f6a0ee2f2a26f3f11cf466fab0364405a23

We could add a '#define __SIZE_TYPE__ unsigned int' there as well, I suppose.

-- 
Ard.



More information about the linux-arm-kernel mailing list