https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93550
Thomas Henlich <thenlich at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |108577
--- Comment #6 from Thomas Henlich <thenlich at gcc dot gnu.org> ---
US 11. Control over leading zeros in output of real values
The leading zero mode controls optional leading zero characters in output with
f, e, d, and g edit descriptors. When the mode is print, the processor produces
a zero in any position that normally contains an optional leading zero. When
the mode is suppress, the processor does not produce such a zero. When the mode
is processor defined, the processor has the choice.
The default mode for a file can be set on its open statement with a leading
zero= specifier with one of the values print, suppress, and processor defined.
If not specified, it is processor defined. An inquire statement can inquire
about the mode for a connection with a leading zero= specifier which is
assigned one of the values print, suppress, or processor defined if the
connection is for formatted i/o and undefined otherwise.
The lzp, lzs, and lz edit descriptors change the mode temporarily during the
execution of an output statement to print, suppress, and processor defined,
respectively. They have no effect during the execution of an input statement.
Introduction
Fortran 2023 contains several extensions to Fortran 2018; these are listed
below.
Input/output:
... The LEADING_ZERO= specifier in the OPEN and WRITE statements, and the LZP,
LZS and LZ control edit descriptors, provide control of optional leading zeros
during formatted output. ...
12.5.6.12 LEADING_ZERO= specifier in the OPEN statement
1 The scalar-default-char-expr shall evaluate to one of PRINT, SUPPRESS, or
PROCESSOR_DEFINED. The LEADING_ZERO= specifier is permitted only for a
connection for formatted input/output. It specifies the leading zero mode
(13.8.5, 12.6.2.10) for this connection. It is a changeable mode (12.5.2). If
this specifier is omitted in an OPEN statement that initiates a connection, the
default value is PROCESSOR_DEFINED.
12.6.2.10 LEADING_ZERO= specifier in a data transfer statement
1 The scalar-default-char-expr shall evaluate to PRINT, SUPPRESS, or
PROCESSOR_DEFINED. The LEADING_ZERO= specifier temporarily changes (12.5.2) the
leading zero mode (13.8.5, 12.5.6.12) for the connection. If the specifier is
omitted, the mode is not changed.
13.8.5 LZS, LZP and LZ editing
1 The LZS, LZP, and LZ edit descriptors temporarily change (12.5.2) the leading
zero mode (12.5.6.12, 12.6.2.10) for the connection. The edit descriptors LZS,
LZP, and LZ set the leading zero mode corresponding to the LEADING_ZERO=
specifier values SUPPRESS, PRINT, and PROCESSOR_DEFINED, respectively.
2 The leading zero mode controls optional leading zero characters in numeric
output fields. When the leading zero mode is PRINT, the processor shall produce
a leading zero in any position that normally contains an optional leading zero.
When the leading zero mode is SUPPRESS, the processor shall not produce a
leading zero in such positions. When the leading zero mode is
PROCESSOR_DEFINED, the processor has the option of producing a leading zero or
not in such positions, subject to 13.7.2(5).
3 The LZS, LZP, and LZ edit descriptors affect only F, E, D, and G editing
during the execution of an output statement. The LZS, LZP, and LZ edit
descriptors have no effect during the execution of an input statement.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108577
[Bug 108577] [meta-bug] Fortran 2023 support