This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45710] WRITE of NAMELIST group to internal file contains newline characters
- From: "urbanjost at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2010 16:35:31 -0000
- Subject: [Bug fortran/45710] WRITE of NAMELIST group to internal file contains newline characters
- References: <bug-45710-18131@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from urbanjost at comcast dot net 2010-09-18 16:35 -------
Subject: Re: WRITE of NAMELIST group to internal file contains newline
characters
The irony in that question is that the obscurity of the example is a direct
result of the unexpected
behavior of write of a NAMELIST into an internal file. The original question
I was asked was
reduced to a much simpler test case, and the question "why does the
following program start to
fail when the variable E is added to the NAMELIST group?".
PROGRAM NMIF
INTEGER :: A=1,B=2,C=3,D=4,E=5
!NAMELIST /NL1/ A,B,C,D ! works in gfortran
NAMELIST /NL1/ A,B,C,D,E ! End of record error in gfortran
CHARACTER(LEN=80) :: OUT(10)
OUT=' '
WRITE(OUT,NL1)
WRITE(*,'(A)')OUT
END PROGRAM NMIF
The code then mutated during an e-mail-only conversion, where
it ended up that filling OUT with an @ character and numbering the lines
made it much clearer what
was truly an output record and what was not; and just how several people had
become convinced that
the output from the NAMELIST output was in the form of "one variable per
line". So what was
required to clarify an issue for a number of people ended up confusing you.
Also note that every
compiler tried (XL, ifort, g95, gfortran) had different results, which was
only clear when OUT was
filled with a non-white-space character and annotated. Looking back on it I
see that what we
thought was a trivial example program could confuse someone not privy to the
discussions that lead
from the above example code to what was entered in bugzilla.
So obscurity lead to obscurity.
----- Original Message -----
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: <urbanjost@comcast.net>
Sent: Friday, September 17, 2010 5:53 PM
Subject: [Bug fortran/45710] WRITE of NAMELIST group to internal file
contains newline characters
>
>
> ------- Comment #1 from kargl at gcc dot gnu dot org 2010-09-17
> 21:53 -------
> Could you format your bug report any more poorly?
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45710
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45710