This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ABSTRACT interfaces + PROCEDURE declarations


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]