[Bug fortran/93733] F2008: G0.d output editing for integer/logical/character data

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Tue Jul 14 09:14:55 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93733

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
With

--- ../_clean/gcc/fortran/io.c  2020-07-01 18:25:56.000000000 +0200
+++ gcc/fortran/io.c    2020-07-14 11:06:50.000000000 +0200
@@ -894,7 +894,13 @@ data_desc:
                               &format_locus))
            return false;
          u = format_lex ();
-         if (u != FMT_PERIOD)
+         if (u == FMT_PERIOD)
+           {
+             if (!gfc_notify_std (GFC_STD_F2018, "%<G0.d%> in format at %L", 
+                                  &format_locus))
+               return false;
+           }
+         else

I get

g% gfc pr93733.f90 -std=f2008
pr93733.f90:7:12:

    7 |     write(*, "(g0.2)")  -23
      |            1
Error: Fortran 2018: 'G0.d' in format at (1)
pr93733.f90:8:12:

    8 |     write(*, "(g0.2)")  .true.
      |            1
Error: Fortran 2018: 'G0.d' in format at (1)
pr93733.f90:9:12:

    9 |     write(*, "(g0.2)")  'hello'
      |            1
Error: Fortran 2018: 'G0.d' in format at (1)

Does it look good?


More information about the Gcc-bugs mailing list