This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug in namelist read
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>, "'bug-gcc at gnu dot org'" <bug-gcc at gnu dot org>, "Harper, Christie" <harper at huntsville dot sparta dot com>
- Subject: bug in namelist read
- From: "Harper, Christie" <harper at huntsville dot sparta dot com>
- Date: Thu, 30 Nov 2000 16:00:40 -0600
we have found a bug with the namelist read of logical variables.
g77 version 2.95.2 19991024 (release)
the problem appears when you read in variables whose name begins
with a "t" or an "f" after you read in the logical variable.
trying the suggested compiler options had no effect.
it ignores the values associated with the "t" or "f" variable name
and sets the logical values to true or false.
this program illustrates the point
program simerr
logical tf(5)
namelist /list/ tf,tt,ff,xyz
open (unit=1,status='old',name='simerr.inp')
do i=1,5
tf(i)=.false.
enddo
read(1,list)
write(6,list)
stop
end
input file:
&list
tf=.t.,.f.,.t.,
ff=33.,
tt=23.0,
xyz=-1234.55,
&end
you would expect the output
tf=.t.,.f.,.t.,.f.,.f.,
ff=33.,
tt=23.,
xyz=-1234.55
what you get is:
TF = T F T F T,
TT = 0.,
FF = 0.,
XYZ = -1234.55005/
christie harper
SPARTA Inc.
(256) 837-5282 x 1216