Un-believable bug

N.M. Maclaren nmm1@cam.ac.uk
Mon Oct 6 09:33:00 GMT 2014


On Oct 6 2014, Steven Bosscher wrote:
>
>>> (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.

Only for the reason you give - it's trivial to parse if you are using
only free format (or only modern fixed format).  Let's ignore the very
old aberrations, which almost everyone has now forgotten ....

For comparison, I don't believe that there are two C++ compilers with
independently written, fully compatible parsers.

>(Oh if only fixed format would have been made obsolescent in Fortran
>90, and removed for Fortran 200x...)

It was certainly obsolescent in Fortran 95.  Removing it is tricky,
because of Fortran's attitude to dusty decks and the number of them
still in use.  WG5 would like to do it, but ....

>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.

There is a good argument for warning about them with -Wextra, because
they are often confusing and can easily occur by accident (finger
trouble with ' and ; on UK keyboards, for a start).  What do people
think?

>> 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...

The only programmers who are think they are infallible are almost
infallibly wrong ....


Regards,
Nick Maclaren.



More information about the Fortran mailing list