[patch, fortran] fixes for the EXIT intrinsic function (PR30933)

Tobias Burnus burnus@net-b.de
Sat Feb 24 19:18:00 GMT 2007


Steve Kargl wrote:
> Unfortunately, no.  You're looking at a merging of different
> novice contributions to gfortran.  I wrote some of the g77
> intrinsics to cut my teeth, and then FX wrote several more g77
> intrinsics as his intrduction to gfortran.  Others contributed
> intrinsics in the dark ages when gfortran only worried about
> integer(4) and (8).
In any case which of the following option should we choose for those
non-time critical functions which call C library functions? Currently,
we have a mixure of (i), and (iv).

i. Add i1, i2, and i16 versions to libgfortran

ii. Convert kind > 8 to integer(8) and kind < 4 to integer(4)

iii. As POSIX defines "exit(int)" and sizeof(int) is on most systems "4"
convert everything to integer(4)

iv. Convert everything to the default integer, i.e. integer(4) or
integer(8) depending whether -fdefault-integer-8 is used.

While (iv) is the easiest, it somehow looks a bit arbitrary. I therefore
would prefer either of (i) to (iii), with (iii) seeming to be the
cleanest - at least if one uses the same kind as the C library does.
(How does one ensure this?)


More information about the Gcc-patches mailing list