[PATCH] elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.
Alexander Cherepanov
ch3root@openwall.com
Wed Apr 22 08:59:00 GMT 2015
On 2015-04-22 11:33, Florian Weimer wrote:
> On 04/22/2015 10:25 AM, Andreas Schwab wrote:
>> Florian Weimer <fweimer@redhat.com> writes:
>>
>>> I think the safer change is to use -0x80000000 as the value of the
>>> constant, without making it unsigned.
>>
>> -0x80000000 has unsigned type.
>
> Ugh. The joys of C.
>
> Using a cast would rely on a GCC extension, so one has to write
> (-2147483647 - 1) to get the desired value. Wow.
Given that stdint.h is already included it's perhaps easier to just use
INT32_MIN?
I've replied about it and other issues in the previous thread but I'm
afraid I'm lost all Cc there. Here it is:
https://sourceware.org/ml/libc-alpha/2015-04/msg00257.html
--
Alexander Cherepanov
More information about the Libc-alpha
mailing list