public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30107]  New: improve diagnostic of RECURSIVE LOGICAL SUBROUTINE
@ 2006-12-07 10:38 dfranke at gcc dot gnu dot org
  2006-12-07 14:21 ` [Bug fortran/30107] " burnus at gcc dot gnu dot org
  2007-07-05 13:37 ` dfranke at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2006-12-07 10:38 UTC (permalink / raw)
  To: gcc-bugs

The diagnostic of the code below is rather "generic". A more verbose message
would be preferable. Without RECURSIVE, gfortran gives "Error: Syntax error in
data declaration".

$> cat foo.f90
RECURSIVE LOGICAL SUBROUTINE foo()
END SUBROUTINE

$> gfortran-svn -c -Wall -g foo.f90
foo.f90:1:

RECURSIVE LOGICAL SUBROUTINE foo()
1
Error: Unclassifiable statement at (1)

$> gfortran-svn -v
gcc version 4.3.0 20061206 (experimental)


-- 
           Summary: improve diagnostic of RECURSIVE LOGICAL SUBROUTINE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30107] improve diagnostic of RECURSIVE LOGICAL SUBROUTINE
  2006-12-07 10:38 [Bug fortran/30107] New: improve diagnostic of RECURSIVE LOGICAL SUBROUTINE dfranke at gcc dot gnu dot org
@ 2006-12-07 14:21 ` burnus at gcc dot gnu dot org
  2007-07-05 13:37 ` dfranke at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-12-07 14:21 UTC (permalink / raw)
  To: gcc-bugs



------- 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 LOGICAL@SUBROUTINE
***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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30107] improve diagnostic of RECURSIVE LOGICAL SUBROUTINE
  2006-12-07 10:38 [Bug fortran/30107] New: improve diagnostic of RECURSIVE LOGICAL SUBROUTINE dfranke at gcc dot gnu dot org
  2006-12-07 14:21 ` [Bug fortran/30107] " burnus at gcc dot gnu dot org
@ 2007-07-05 13:37 ` dfranke at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-05 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2007-07-05 13:36 -------
An attempt is made to match it as a variable declaration which fails because 

    LOGICAL SUBROUTINE foo

either misses th '::' or a ',' between SUBROUTINE and FOO resulting in a
"Syntax error in data declaration". Matching as subroutine, as intended won't
work either as subroutines must not have a type.

I agree on WONTFIX. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-05 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-07 10:38 [Bug fortran/30107] New: improve diagnostic of RECURSIVE LOGICAL SUBROUTINE dfranke at gcc dot gnu dot org
2006-12-07 14:21 ` [Bug fortran/30107] " burnus at gcc dot gnu dot org
2007-07-05 13:37 ` dfranke at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).