public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/114611] New: H edit descriptor should flag as error with -std-f95 (or higher)
@ 2024-04-05 19:19 w6ws at earthlink dot net
  2024-04-07 18:43 ` [Bug fortran/114611] " jvdelisle at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: w6ws at earthlink dot net @ 2024-04-05 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114611
           Summary: H edit descriptor should flag as error with -std-f95
                    (or higher)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: w6ws at earthlink dot net
  Target Milestone: ---

When an H edit descriptor is used in a format, only a warning is given when
-std=f95 (or higher) is specified.  It should be an error, as are other ancient
features that were deleted in F95 such as PAUSE and ASSIGN/assigned GO TO.

Note in the following example that PAUSE gives an error, whereas use of the H
edit descriptor is only a warning:

wws@w6ws-4:/tmp/wws$ cat fmt1.f90
program fmt1
  implicit none

  pause 13

  print 100
100 format (1H ,"Hello World")
end program
wws@w6ws-4:/tmp/wws$ gfortran -std=f95 fmt1.f90
fmt1.f90:4:10:

    4 |   pause 13
      |          1
Error: Deleted feature: PAUSE statement at (1)
fmt1.f90:7:17:

    7 | 100 format (1H ,"Hello World")
      |                 1
Warning: The H format specifier at (1) is a Fortran 95 deleted feature
wws@w6ws-4:/tmp/wws$ 
wws@w6ws-4:/tmp/wws$ gfortran --version
GNU Fortran (GCC) 14.0.1 20240115 (experimental)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

wws@w6ws-4:/tmp/wws$

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/114611] H edit descriptor should flag as error with -std-f95 (or higher)
  2024-04-05 19:19 [Bug fortran/114611] New: H edit descriptor should flag as error with -std-f95 (or higher) w6ws at earthlink dot net
@ 2024-04-07 18:43 ` jvdelisle at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2024-04-07 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jvdelisle at gcc dot gnu.org
   Last reconfirmed|                            |2024-04-07

--- Comment #1 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Here is a fix. It wiggles on about 5 test cases that will need to be adjusted.

diff --git a/gcc/fortran/io.cc b/gcc/fortran/io.cc
index 6fd69f7c9a8..e6a5144b028 100644
--- a/gcc/fortran/io.cc
+++ b/gcc/fortran/io.cc
@@ -1129,12 +1129,10 @@ data_desc:
       break;

     case FMT_H:
-      if (!(gfc_option.allow_std & GFC_STD_GNU) && !inhibit_warnings)
+      if (!gfc_notify_std (GFC_STD_F95_DEL, "H format specifier at %C"))
        {
          if (mode != MODE_FORMAT)
            format_locus.nextc += format_string_pos;
-         gfc_warning (0, "The H format specifier at %L is"
-                      " a Fortran 95 deleted feature", &format_locus);
        }
       if (mode == MODE_STRING)
        {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-07 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 19:19 [Bug fortran/114611] New: H edit descriptor should flag as error with -std-f95 (or higher) w6ws at earthlink dot net
2024-04-07 18:43 ` [Bug fortran/114611] " jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).