This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31817] New: Give at least a warning for specification function without explicit interface
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2007 16:27:35 -0000
- Subject: [Bug fortran/31817] New: Give at least a warning for specification function without explicit interface
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
"A function is a specification function if it is a pure function, is not a
standard intrinsic function, is not an internal function, is not a statement
function, and does not have a dummy procedure argument."
This is true for "fn" in:
function f2 (fn, i)
integer :: i, fn
character (len = fn (i)) :: f2
Other compilers give an error as "fn" has no explicit interface (with "PURE").
gfortran simply accepts this statement function. It should at least spit out a
warning.
$ ifort gfortran.dg/char_result_7.f90
fortcom: Error: gfortran.dg/char_result_7.f90, line 36: An explicit interface
is required for a specification function. [FN]
$ NAG f95 gfortran.dg/char_result_7.f90
Error: gfortran.dg/char_result_7.f90, line 36: Reference to non-specification
function FN in specification expression
$ g95 gfortran.dg/char_result_7.f90 [...]
Error: Specification function 'fn' at (1) must be PURE
--
Summary: Give at least a warning for specification function
without explicit interface
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31817