This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ
- From: "paul dot richard dot thomas at cea dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2004 13:41:26 -0000
- Subject: [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Example below - 1st namelist can be read but second, in output format, cannot.
>From a bit of exploration, I find that a namelist containing more than one
value cannot contain whitespace or newlines.
$ cat bug3.f90;/irun/bin/gfortran -v bug3.f90 ; ./a.exe
program bug3
integer :: num1 , num2 , num3 =42 , num4 = 56
namelist /mynml1/ num1,num2
namelist /mynml2/ num3,num4
open(unit=10,file='bug3.txt',status='unknown')
write(10,'(A)') "&mynml1,num1=16,num2=32,&end"
!
! write mynml2
!
write(10,mynml2)
close(10)
!
! now read back
!
open(unit=10,file='bug3.txt',status='old')
read(10,mynml1)
print *, "1st READ is OK"
write(*,mynml1)
read(10,mynml2)
print *, "2nd READ is OK"
write(*,mynml2)
close(10)
end program bug3
Driving: /irun/bin/gfortran -v bug3.f90 -lgfortranbegin -lgfortran
Reading specs from /irun/lib/gcc/i686-pc-cygwin/3.5.0/specs
Configured with: ../gcc-3.5-20040815/configure --with-gmp=/gmp --with-mpfr=/gmp
--prefix=/irun --enable-languages=c,c++,f95
Thread model: single
gcc version 3.5.0 20040815 (experimental)
/irun/libexec/gcc/i686-pc-cygwin/3.5.0/f951.exe bug3.f90 -quiet -dumpbase bug3.
f90 -mtune=pentiumpro -auxbase bug3 -version -o /cygdrive/c/DOCUME~1/THOMASP/LOC
ALS~1/Temp/cciuEhJj.s
GNU F95 version 3.5.0 20040815 (experimental) (i686-pc-cygwin)
compiled by GNU C version 3.5.0 20040719 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
as -o /cygdrive/c/DOCUME~1/THOMASP/LOCALS~1/Temp/ccNr91Rn.o /cygdrive/c/DOCUME~
1/THOMASP/LOCALS~1/Temp/cciuEhJj.s
/irun/libexec/gcc/i686-pc-cygwin/3.5.0/collect2.exe -Bdynamic --dll-search-pref
ix=cyg /lib/crt0.o -L/irun/lib/gcc/i686-pc-cygwin/3.5.0 -L/irun/lib/gcc/i686-pc-
cygwin/3.5.0/../../.. /cygdrive/c/DOCUME~1/THOMASP/LOCALS~1/Temp/ccNr91Rn.o -lgf
ortranbegin -lgfortran -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -
lgcc
1st READ is OK
&mynml1
num1= 16,num2= 32,/
At line 20 of file bug3.f90
Internal Error: Can not match a namelist variable
--
Summary: namelist containing more than one value cannot contain
whitespace or newlines for READ
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paul dot richard dot thomas at cea dot fr
CC: gcc-bugs at gcc dot gnu dot org,paulthomas2 at wanadoo
dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17286