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

Daniel Franke franke.daniel@gmail.com
Fri Feb 23 22:55:00 GMT 2007


On Friday 23 February 2007 23:43:38 Tobias Burnus wrote:
> Daniel Franke schrieb:
> >> For (b) there are several options:
> >>
> >> 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.
> >
> > FLUSH implements (iii)
>
> No, FLUSH implements (iv):
>
>   ts.type = BT_INTEGER;
>   ts.kind = gfc_default_integer_kind; /* <<<< can be 4 or 8 */
>   n = c->ext.actual->expr;
>   if (n != NULL && n->ts.kind != ts.kind)
>     gfc_convert_type (n, &ts, 2);
>
> That is also the reason that there is not flush() but flush_i4() and
> flush_i8() in libgfortran/io/intrinsic.c.

Standing corrected. Thanks.
Nevertheless, at least, it does not implement the suggested option.

Is stuff like this documented somewhere or is it obvious for those more 
familiar with the code than I am? Just glancing over it, checking the dump(s) 
and the output of 'nm' is obviously not enough ...



More information about the Fortran mailing list