[Bug fortran/89103] New: Allow blank format items in format strings

mark.eggleston at codethink dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 29 14:46:00 GMT 2019


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

            Bug ID: 89103
           Summary: Allow blank format items in format strings
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mark.eggleston at codethink dot com
  Target Milestone: ---

Created attachment 45554
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45554&action=edit
Patch to allow blank item in format

gfortran as of revision: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268360

At the end of list of specifiers a blank item can appear between the comma and
closing bracket.

The following error is produced, as it should be:

   18 | 10        FORMAT( I5,)
      |                      1
Error: Unexpected element ')' in format string at (1)

In legacy Fortran this is not the case PGI Fortran 18.10 silently accepts this
with no compiler switches. I believe this is feature originated from DEC
Fortran.

Attached is a patch that will allow this.

As this is non-standard Fortran this feature is only enabled using
-fdec-blank-format-item which is also enabled by -fdec.


More information about the Gcc-bugs mailing list