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 IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics


: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


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