Re: [next:master 156/212] fs/binfmt_elf.c:158:18: note: in expansion of macro 'min'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/26/2014 14:19 PM, David Rientjes wrote:
> On Thu, 26 Jun 2014, Jeff Liu wrote:
> 
>>>>>    fs/binfmt_elf.c: In function 'get_atrandom_bytes':
>>>>>    include/linux/kernel.h:713:17: warning: comparison of distinct pointer types lacks a cast
>>>>>      (void) (&_min1 == &_min2);  \
>>>>>                     ^
>>>>>>> fs/binfmt_elf.c:158:18: note: in expansion of macro 'min'
>>>>>       size_t chunk = min(nbytes, sizeof(random_variable));
>>>>
>>>> I remember we have the same report on arch mn10300 about half a year ago, but the code
>>>> is correct. :)
>>>>
>>>
>>> Casting the sizeof operator to size_t would fix this issue on am33.
>>
>> Thanks for pointing this out, I once considered to use min_t() to do explicitly casting.
>> However, both values to compare are already size_t, maybe this depending on the compiler's
>> result of what sizeof() would be...
>>
> 
> Have you read arch/mn10300/include/uapi/asm/posix_types.h?  am33 defines 
> this to be unsigned int for gcc version 4.  You would not see this warning 
> with gcc major version != 4 or if you do what I suggested and cast it to 
> size_t.

Ah, that solves it, thanks! 0day tests with am33 cross compiler version 4.6.3.

Cheers,
-Jeff

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]