------- Comment #1 from burnus at gcc dot gnu dot org  2006-12-07 14:21 -------
While I agree that the message is not that helpful, other compilers don't do
much better. (The problem is: There are zillions of ways to write invalid
code.)

I'd favour a WONTFIX, but maybe someone has a good idea and is bored ...


Besides, the question is how should the error message look like? I don't like
the following messages better:

NAG f95:
Error: af.f90, line 1: syntax error
       detected at [EMAIL PROTECTED]
***Malformed statement


g95 / gfortran:
RECURSIVE LOGICAL SUBROUTINE foo()
1
Error: Unclassifiable statement at (1)
In file af.f90:2
END SUBROUTINE
   1
Error: Expecting END PROGRAM statement at (1)


ifort:
fortcom: Error: af.f90, line 1: Syntax error, found IDENTIFIER 'SUBROUTINE'
when expecting one of: TYPE COMPLEX BYTE CHARACTER DOUBLE DOUBLECOMPLEX
DOUBLEPRECISION INTEGER LOGICAL ...
RECURSIVE LOGICAL SUBROUTINE foo()
------------------^
fortcom: Error: af.f90, line 2: This is an invalid statement; an END [FUNCTION]
statement is required.
END SUBROUTINE
^
fortcom: Warning: af.f90, line 1: The return value of this FUNCTION has not
been defined.   [FOO]
RECURSIVE LOGICAL SUBROUTINE foo()
-----------------------------^
compilation aborted for af.f90 (code 1)


sunf95:
RECURSIVE LOGICAL SUBROUTINE foo()
                  ^
"af.f90", Line = 1, Column = 19: ERROR: Unexpected syntax: "[ELEMENTAL] [PURE]
FUNCTION" was expected but found "S".
END SUBROUTINE
^
"af.f90", Line = 2, Column = 1: ERROR: This END SUBROUTINE statement has no
matching SUBROUTINE statement.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30107

Reply via email to