This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41678] Format label as second item in io control list is rejected
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2009 18:03:05 -0000
- Subject: [Bug fortran/41678] Format label as second item in io control list is rejected
- References: <bug-41678-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from dominiq at lps dot ens dot fr 2009-10-13 18:03 -------
> It would be interesting to get the opinion of Richard Maine.
> > ...
> > The wording in the f2003/2008 drafts I have at hand is more ambiguous:
> > ...
> > Does a io-unit in C917 includes the optional characters UNIT=? If yes,
> > is it correct to understand that read(unit=2, 100) is allowed in
> > f2003/2008?
Richard Maine's answer:
dominiq <domi...@lps.ens.fr> wrote:
> read(unit=2, 100) is invalid under f95 because of:
> Constraint:... [elided]
> The wording in the f2003/2008 drafts I have at hand is more ambiguous:
I'd disagree. I'd say it was more concise and precise in that it uses
bnf terms instead of repeating them as textual descriptions.
...
> C917 (R913) If format appears without a preceding FMT=, it shall be
> the
> second item in the io-control-spec-list and the first item
> shall
> be io-unit.
...
> R901 io-unit is file-unit-number
> or *
> or internal-file-variable
> Does a io-unit in C917 includes the optional characters UNIT=? If yes,
> is it correct to understand that read(unit=2, 100) is allowed in
> f2003/2008?
No. You have misinterpreted this as illustrated by the extra word you
added. It is a very small extra word, but an important one. C917 refers
to "io-unit". It does not refer to "a io-unit". Note also that io-unit
is italicized. (This doesn't show up if you have only a plain text copy,
but the actual standard is not plain text).
The italicized io-unit is a bnf term. You cited the definition (R901).
That definition does not include UNIT=. The thing that includes an
optional UNIT= is the UNIT= specifier. "Io-unit" is not a sloppy
abbreviation for "the UNIT= specifier", which is how it looks like you
are interpreting it.
When the standard uses an bnf term, it means it literally - that exact
syntax. The fact that a UNIT= specifier can have the form io-unit does
not imply that "io-unit" is a synonym for the UNIT= specifier.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
So the PR can probably be closed as INVALID.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41678