Un-believable bug
Steven Bosscher
stevenb.gcc@gmail.com
Mon Oct 6 08:02:00 GMT 2014
On Sun, Oct 5, 2014 at 9:59 PM, Steve Kargl wrote:
> On Sun, Oct 05, 2014 at 12:15:41PM -0700, Alan Greynolds wrote:
>> Over the years I have been occasionally surprised by bugs in
>> gfortran's handling of multiple statements on a line using
>> the ';' delimiter
And of course you've helped out by filing bug reports for these surprising bugs?
>> (no other compiler I have used has ever
>> had this problem).
Other compilers have other parsers. You'll probably find errors in
other compilers that gfortran doesn't have. Fortran is just an
inconvenient language to parse.
(Oh if only fixed format would have been made obsolescent in Fortran
90, and removed for Fortran 200x...)
>> The latest is illustrated by the the
>> following 2 line program:
>>
>> implicit real (a-h,o-z); parameter (i=0)
>> end
>>
>> If you split up the first line, gfortran is happy! I would
>> think gfortran would have some sort of 'preprocess' step that
>> handles multiple statement lines flawlessly.
gfortran processes the input directly, without preprocessing (apart
from C preprocessor stuff). It should handle multiple statements per
line without trouble but apparently there's a bug in the parser. It's
probably something that's trivial to fix.
Multiple statements are apparently not very common. I, for one, have
never used them. With a quick grep through the test suite and through
roughly 12 million lines of Fortran code from various sources, I
couldn't find a single multi-statement line.
> PS: I'm shocked that the gfortran developers aren't infallible.
Well, we aren't infallible only by choice, aren't we? Because perfect
is boring...
Ciao!
Steven
More information about the Fortran
mailing list