This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[fortran,patch] Use new stdint.h-related macros in ISO_C_BINDING
- From: FX <fxcoudert at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Sat, 16 May 2009 23:22:14 +0200
- Subject: [fortran,patch] Use new stdint.h-related macros in ISO_C_BINDING
Hi all,
The attached patch modifies the definitions of ISO_C_BINDING constants
for INT*_T, INT_LEAST*_T and INT_FAST*_T so that we use the newly
introduced stdint.h-related macros introduced by Joseph Myers (thanks
Joseph)! Currently, we use ad hoc methods for determining INT*_T and
INT_LEAST*_T, and we used -2 for INT_FAST*_T (which is what the
standard mandates to mean "unsupported by the companion C compiler").
The longest part of the patch is the function
get_typenode_from_name(): because target macros define names for the
types (i.e., INT8_T might be "signed char") and, unlike the C front-
end, the Fortran front-end doesn't have these type names registered,
we need to do string comparison to find the appropriate type node.
The patch also adds the following ISO_FORTRAN_ENV named integer
parameters: INT8, INT16, INT32, INT64 (which correspond to the INT*_T)
and REAL32, REAL64 and REAL128 (which correspond to integers kinds of
a given width).
Finally, the testcases are modified to check for the validity of all
the constants. The tests might come to fail (while they previously
passed) in some targets that haven't yet registered stdint.h-related
target macros. For now, this job is done for all glibc and newlib
targets, as well as cygwin, mingw, HP-UX and AIX [*]. Others beware.
Bootstrapped and regtested on x86_64-linux (both -m32 and -m64). OK to
commit?
FX
Attachment:
stdint.ChangeLog
Description: Binary data
Attachment:
stdint.diff
Description: Binary data
[*] A patch for darwin (by yours truly) has been gathering dust for a
month and a half while waiting for a review