possible bug (accepting null character as input)

Faheem Mitha faheem@email.unc.edu
Wed Feb 16 03:23:00 GMT 2005


Dear People,

The following program behaves differently with the Intel compiler and
with gcc 4.0 (Debian prerelease).

gfortran-4.0 --version
GNU Fortran 95 (GCC 4.0.0 20050125 (experimental) (Debian 4.0-0pre5))

With Intel, hitting return at the "hit return" prompt gives the
message "well done".

OTOH, with gfort, nothing happens when hitting return at the
prompt. It just hangs.

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.

Please cc any reply to me at faheem@email.unc.edu. I'm not sure what
mailing list this corresponds to (I'm posting via gmane).

                                                             Faheem.

********************************************************************
program testRead

implicit none

character(1) resp

write (*,'('' hit return: '',$)')
read (*,'(a)') resp

write (*,'('' well done.'')')
end



More information about the Fortran mailing list