[PATCH] elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.

Florian Weimer fweimer@redhat.com
Wed Apr 22 08:33:00 GMT 2015


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.

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list