How can a front-end know what integer mode corresponds to int_fastN_t?
Geoffrey Keating
geoffk@apple.com
Tue Oct 17 03:40:00 GMT 2006
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.
More information about the Gcc
mailing list