[gfortran,patch] Add IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics

Tobias Burnus burnus@net-b.de
Wed Aug 29 15:26:00 GMT 2007


:REVIEWMAIL:

François-Xavier Coudert wrote:
> Attached patch adds the IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics.
> Documentation and testcase are Tobias' (thanks!). Bootstrapped and
> regtested on x86_64-linux, OK to commit?
>   

+    case GFC_ISYM_IS_IOSTAT_END:
+      gfc_conv_has_intvalue (se, expr, -1);
+      break;
+
+    case GFC_ISYM_IS_IOSTAT_EOR:
+      gfc_conv_has_intvalue (se, expr, -2);

I wonder whether one should add some comment, e.g.
      gfc_conv_has_intvalue (se, expr, -2);  /* IOSTAT_EOR == -2.  */

this makes the numbers a bit less magic; on the other hand, the function
is already called "gfc_conv_has_intvalue" and together with
"GFC_ISYM_IS_IOSTAT_END" it is not really needed.


OK with or without this change. (Assuming that I may review my texi
patch and testcase ;-)


I think these were the last missing Fortran 2003 intrinsics.

(I have to admit, I find them quite useless; what is the advantage of 
"if(IS_IOSTAT_END(status))" to "if(IOSTAT_END == status)" - except that
one saves one line ("use iso_fortran_env")? Or vice versa, why is there
a constant if there is an intrinsic function?)

Tobias



More information about the Fortran mailing list