[Fortran, Patch] PR33228 Improve checking for MODULE PROCEDURE

Tobias Burnus burnus@net-b.de
Thu Aug 30 14:08:00 GMT 2007


:ADDPATCH fortran:

The Fortran 2003 standard states:

"C1208 (R1206) If MODULE appears in a procedure-stmt, each
procedure-name in that statement shall be accessible in the current
scope as a module procedure."

"module procedure (2.2.3.2) : A procedure that is defined by a module
subprogram."

The following is not module procedure, even if one USEs the module:

module a
  interface
    subroutine sub()
    end subroutine sub
  end interface
end module a

gfortran was accepting this, g95 and NAG f95 rejected this. See also,
esp. the second post by Richard Maine.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/4d51d6ca89f7d4f8/

In the patch, I also updated some error messages so that they are more
helpful.

(By the way, if one wants to to include the subroutine sub in an generic
interface, one can use in Fortran 2003 the PROCEDURE statement; this
needs Janus' PROCEDURE patch.)

Build and regression tested on x86_64-unknown-linux-gnu.
OK for the trunk?

Tobias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: modproc.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070830/747832dc/attachment.ksh>


More information about the Fortran mailing list