This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: proposal to make SIZE_TYPE more flexible
- From: DJ Delorie <dj at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 30 Oct 2013 15:17:59 -0400
- Subject: Re: proposal to make SIZE_TYPE more flexible
- Authentication-results: sourceware.org; auth=none
- References: <201310300422 dot r9U4M6Mx002568 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1310301535400 dot 22878 at digraph dot polyomino dot org dot uk>
> It is a deficiency that SIZE_TYPE is defined to be a string at all (and
> likewise for all the other target macros for standard typedefs including
> all those for <stdint.h>). Separately, it's a deficiency that these
> things are target macros rather than target hooks.
My thought was that there'd be a set of target hooks that returned a
TREE for various types. But as an interim solution, the checks that
use strcmp() should fail into a type lookup-by-name. I.e. replace the
gcc_unreachables with expensive table lookups.
I think there's an advantage in newlib to having a macro that expands
to the type-as-a-string needed for various types. Of course, if gcc
had a typedef for those types, that would be better, but slightly
harder to autodetect.
> Instead of having an __int128 keyword (target-independent) targets
> would be able to define a set of N for which there are __intN
> keywords and for which everything handling __int128 will equally
> handle __intN.
That sounds great, and would elide the problem of a target needing to
register their own types for those. I hadn't considered simplifying
the intN_t problem, since you *can* register custom types, I was
mostly just thinking about how to *use* those types for size_t et al.