This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How can a front-end know what integer mode corresponds to int_fastN_t?
- From: Geoffrey Keating <geoffk at apple dot com>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 16 Oct 2006 20:39:47 -0700
- Subject: Re: How can a front-end know what integer mode corresponds to int_fastN_t?
- References: <9006D653-3D48-457E-BD9A-9D7C15878630@gmail.com>
FX Coudert <fxcoudert@gmail.com> writes:
> Hi all,
>
> For Fortran 2003 standard conformance, the Fortran front-end has to
> know at compile-time what integer mode corresponds to some C99 types,
> like intmax_t, intN_t, int_leastN_t, int_fastN_t.
>
> For intN_t and int_leastN_t, I can see how to get them by looking at
> the width of the different integer modes. For intmax_t, it is defined
> in c-common.h as:
>
> #define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
> ? "int" \
> : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
> ? "long int" \
> : "long long int"))
>
> But I cannot see how the front-end can know the integer mode for
> int_leastN_t. We're likely to include this functionality for the 4.3
> release, so I'll be happy to get a large number of suggestions around
> on how to implement that.
It's a property of the ABI on the target. The only way to know is to
have someone (or something) tell you. Even the macro above can be
redefined by a target.
One nice thing would be that if we actually had GCC know about all the
contents of stdint.h, then maybe GCC could provide it; we have a
policy that GCC provides all the headers of a freestanding
implementation, and this is the only one missing.