This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: ABSTRACT interfaces + PROCEDURE declarations
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janus Weil <jaydub66 at googlemail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Wed, 15 Aug 2007 18:26:23 +0200
- Subject: Re: ABSTRACT interfaces + PROCEDURE declarations
- References: <854832d40708150758y52b93dean2cf7c0c9e18978be@mail.gmail.com>
Hi Janus,
I played a bit around with your ABSTRACT INTERFACE patch.
You could consider to check for C1203 "the functions-name is the
function-stmt or the subroutine-name in the subroutine-stmt shall not be
the same as a keyword that specifies an intrinsic type." (see 12.3.2.1
for the full quote).
(NAG f95 and g95 don't check; this is a requirement for the user to
fulfil and not for the compiler to diagnose)
Example:
abstract interface
subroutine REAL()
end subroutine REAL
end interface
This is in order to allow for (don't know whether I got the syntax right):
real :: func
external func
PROCEDURE(REAL), POINTER :: pp => func
You should disallow [MODULE] PROCEDURE in ABSTRACT INTERFACE:
"C1204 (R1202) A procedure-stmt is allowed only in an interface block
that has a generic-spec."
Expected:
Error: MODULE PROCEDURE at (1) must be in a generic module interface
(search for this message, is probably in decl.c)
Actually, when PROCEDURE works, the message has to be changed.
C1236 (R1225) A proc-language-binding-spec with a NAME= speciïer shall
not be speciïed in the
function-stmt or subroutine-stmt of an interface body for an
abstract interface or a dummy
procedure.
Which means the following program is invalid:
abstract interface
subroutine my() bind(C,name='foo')
end subroutine my
end interface
end
as NAG f95 also reports:
Error: cc.f90, line 2: NAME= is not allowed on BIND(C) for abstract
interface MY
Tobias