possible bug (accepting null character as input)
Toby White
tow21@cam.ac.uk
Wed Feb 16 11:06:00 GMT 2005
François-Xavier Coudert <Francois-Xavier.Coudert@lcp.u-psud.fr> writes:
>> This may not be a bug. However (I don't use Fortran myself) the author
>> of the original code from which this sample is derived tells me that
>> every Fortran compiler he has ever used (over a period of 20+ years)
>> shows the same behaviour as the Intel compiler.
>
> I can't find a compiler that doesn't do what you expect (gfortran
> excluded, that is).
The '$' character is a non-standard extension to imply non-advancing
write (useful pre-f90, but still supported sometimes). I've come across
it on a number of compilers, but by no means all. I'm fairly sure neither
NAG nor the Sun compilers understand it.
So there's a bug in that gfortran doesn't flag it as an extension
under f95 in addition to the not-reading-a-character-bug.
>>> program testRead
>> implicit none
>> character(1) resp
>> write (*,'('' hit return: '',$)')
>> read (*,'(a)') resp
>> write (*,'('' well done.'')')
>> end
>
> I filed it as 20005 in bugzilla
> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20005).
>
> FX
--
Dr. Toby White
Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK
Email: <tow21@cam.ac.uk>
More information about the Fortran
mailing list