[PATCH] DO_GLOBAL_CTORS_BODY needs uintptr_t

Ian Lance Taylor iant@google.com
Tue Mar 17 22:53:00 GMT 2009


Ozkan Sezer <sezeroz@gmail.com> writes:

>> Since this code is only compiled with the newly built gcc, other options
>> would be to use __PTRDIFF_TYPE__ or __UINTMAX_TYPE__.
>
> AFAIK, __PTRDIFF_TYPE__ is defined (and not typedef'ed) as signed,
> not unsigned. If it won't be a problem, __PTRDIFF_TYPE__ seems as
> a better candidate to me, and can even be used in combination with
> 'unsigned' (although that might be ugly..)

Using a signed type should be fine.  Each constructor uses some number
of bytes, however small, so it's impossible to imagine having more
constructors than half the address space.

Or for that matter __SIZE_TYPE__ should be the unsigned type
corresponding to __PTRDIFF_TYPE__.

Ian



More information about the Gcc-patches mailing list