https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89100
Bug ID: 89100
Summary: Default widths for i, f and g format specifiers 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 45548
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45548&action=edit
Patch to support default widths for f, g and i
gfortran as of revision: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268360
Fortran currently rejects format specifiers i, f and g without widths, e.g:
24 | write(buffer, "(A, F, A)") ':',real_4,':'
| 1
Error: Nonnegative width required in format string at (1)
The PGI Fortran compiler 18.10 silently accepts this with no compiler options.
Jakub Jelinek provided this link
https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-default-widths-for-data-edit-descriptors
showing that ifort also defaults the widths of i, f and g.
Please find attach a patch that provides default widths for f, g and i.
As this feature is non-standard and most likely originated with DEC Fortran it
is only available using the option -fdec-format-defaults which is also enabled
by -fdec.
For trunk and supported versions.