This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,patch] Add ISO_FORTRAN_ENV module


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]