This is the mail archive of the 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: assumes sizeof(size_t) == sizeof(void *)


On 11/10/2014 05:49 PM, Joel Sherrill wrote:
On 11/10/2014 10:32 AM, Joseph Myers wrote:
On Sat, 8 Nov 2014, Paolo Carlini wrote:

Good. Sorry, if I missed some relatively recent development: is now GCC
installing its own stdint.h on *all* the supported targets, thus we can safely
No; I sent a list of targets missing the information in
<> (possibly out
of date now, but the goal there of unifying uint32_type_node and
c_uint32_type_node etc. still applies).

I just submitted a patch using stdint.h and uintptr_t to gcc-patches.
I think this fixes the code in a standard way. I don't know what to
do about the list of targets you cited which don't support that.
If you unconditionally use stdint.h facilities you are going to break the build on other systems, those missing stdint.h. Note that, assuming you want to stick with this sort of general approach, you don't really need to use uintptr_t, you can for example fiddle a bit with templates and figure out on the fly at compile time an unsigned integer type large enough to hold a pointer (for example, what I quickly put together a few years ago toward the end of locale_facets.tcc, in do_put, appears to work decently well)


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