This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran,patch] Add ISO_FORTRAN_ENV module
- From: Brooks Moses <brooks dot moses at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 18 Nov 2006 11:53:34 -0800
- Subject: Re: [gfortran,patch] Add ISO_FORTRAN_ENV module
- Organization: Stanford University
- References: <2C875733-99E1-4E44-BAC6-701E7E9C7325@gmail.com>
FX Coudert wrote:
Attached is the last version of my ISO_FORTRAN_ENV patch, now that
the intrinsic/non-intrinsic modules patch has been commited. I
modified the code to correct the glitches detected by Tobias Burnus.
One question/comment. In trans-types.c, you have:
else
- gfc_default_integer_kind = gfc_integer_kinds[i_index - 1].kind;
+ {
+ gfc_default_integer_kind = gfc_integer_kinds[i_index - 1].kind;
+ gfc_numeric_storage_size = gfc_default_integer_kind * 8;
+ }
/* Choose the default real kind. Again, we choose 4 when possible. */
if (gfc_option.flag_default_real)
@@ -283,6 +298,7 @@
/* Choose the smallest integer kind for our default character. */
gfc_default_character_kind = gfc_integer_kinds[0].kind;
+ gfc_character_storage_size = gfc_default_character_kind * 8;
This assumes that the integer kinds are equal to the size in bytes of
the integer. Is this always true? [Answer to my own question:
Currently, yes; see line 121 of trans-types.c.]
However, I do see that there is a .bit_size field in gfc_integer_kinds;
I think it would probably be a little cleaner to use this rather than
back-calculating the bit size from the kind number.
- Brooks