This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] DO_GLOBAL_CTORS_BODY needs uintptr_t


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]