This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/24794] New: problem with namelist input of character array
- From: "chjacob at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Nov 2005 13:39:56 -0000
- Subject: [Bug libfortran/24794] New: problem with namelist input of character array
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Here is a test program and an input file demostrating the
problem:
christoph@note-jacob ~/namelist $ cat namelist.f90
program bla
implicit none
integer, parameter :: maxop=15, iunit=7
character*8 namea(maxop), nameb(maxop)
integer i
NAMELIST/CCSOPR/ NAMEA,NAMEB
OPEN (iunit, file="input.nml", status='OLD')
READ (iunit, CCSOPR)
CLOSE (iunit)
do i = 1, maxop
write (*,*) "NAMEA (",i,") = ", NAMEA(i)
end do
do i = 1, maxop
write (*,*) "NAMEB (",i,") = ", NAMEB(i)
end do
end program bla
christoph@note-jacob ~/namelist $ cat input.nml
&CCSOPR
NAMEA='SPI01H','SPI02O','SPI03H','SPI04O','SPI05H','SPI06H',
'SPI07O','SPI08H','SPI09H',
NAMEB='SPI01H','SPI03H','SPI05H','SPI06H','SPI08H','SPI09H',
&END
christoph@note-jacob ~/namelist $ gfortran namelist.f90
christoph@note-jacob ~/namelist $ ./a.out
NAMEA ( 1 ) = SPI01H
NAMEA ( 2 ) = SPI02O
NAMEA ( 3 ) = SPI03H
NAMEA ( 4 ) = SPI04O
NAMEA ( 5 ) = SPI05H
NAMEA ( 6 ) = SPI06H
NAMEA ( 7 ) = SPI07O
NAMEA ( 8 ) = SPI08H
NAMEA ( 9 ) = SPI09H
NAMEA ( 10 ) = NAMEB='S
NAMEA ( 11 ) = SPI03H
NAMEA ( 12 ) = SPI05H
NAMEA ( 13 ) = SPI06H
NAMEA ( 14 ) = SPI08H
NAMEA ( 15 ) = SPI09H
NAMEB ( 1 ) = 8\uffff\uffffii
NAMEB ( 2 ) = \uffff\uffff\uffff
NAMEB ( 3 ) = 8\uffff\uffff
NAMEB ( 4 ) = \uffff\uffff\uffff
NAMEB ( 5 ) = n\uffff\u0677\uffffJ\u0677
NAMEB ( 6 ) = \uffff\uffff\u0637
NAMEB ( 7 ) = `
NAMEB ( 8 ) = wP\uffff
NAMEB ( 9 ) = \uffff/\uffff\uffff
NAMEB ( 10 ) = \uffffx^\uffff\uffff
NAMEB ( 11 ) = \uffff6\uffff\uffff\uffff\uffff
NAMEB ( 12 ) = \uffff\uffff8
NAMEB ( 13 ) = \uffff\uffff
NAMEB ( 14 ) = Ht\uffff\uffff
NAMEB ( 15 ) = $\uffff
--
Summary: problem with namelist input of character array
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chjacob at web dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24794