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$

Reply via email to