Fwd: (j3.2006) Submodule/module interface mismatch: is thisstandard-conforming?

Damian Rouson damian@sourceryinstitute.org
Sun Oct 9 13:59:00 GMT 2016


All,

It appears the code example I sent earlier is non-conforming according to constraint C1556.  See below.  I just tried compiling with the -std=f2008 -fcheck=all -Wall flags and it still compiles without error so I filed bug report 77903.

Damian

> Begin forwarded message:
> 
> From: "Malcolm Cohen" <malcolm@nag-j.co.jp>
> Subject: Re: (j3.2006) Submodule/module interface mismatch: is thisstandard-conforming?
> Date: October 8, 2016 at 12:21:39 AM PDT
> To: "fortran standards email list for J3" <j3@mailman.j3-fortran.org>
> Reply-To: fortran standards email list for J3 <j3@mailman.j3-fortran.org>
> 
> The interface body by itself is conforming; if you read the IMPLICIT 
> statement, it says that the implicit mapping in an interface body with no 
> IMPLICIT statement is the usual Fortran REAL(A-H,O-Z) INTEGER(I-N), but the 
> later separate module procedure has different characteristics, so that is 
> not conforming.
> 
> Neither gfortran nor Intel are conforming in this regard (you might need to 
> use some special option to get standard conformance though), as they do not 
> satisfy the constraint:
> 
> C1556 (R1527) If MODULE appears in the prefix of a module subprogram, the 
> subprogram shall specify the same characteristics and dummy argument names 
> as its corresponding module procedure interface body.
> 
> The first error message of the Cray compiler would appear to indicate 
> nonconformance, but the second error message seems to be correct.
> 
> -----Original Message----- 
> From: Damian Rouson
> Sent: Saturday, October 8, 2016 8:22 AM
> To: j3
> Cc: GCC-Fortran-ML
> Subject: (j3.2006) Submodule/module interface mismatch: is 
> thisstandard-conforming?
> 
> 
> All,
> 
> Is the program below standard-conforming?  The Cray compiler gives an error 
> message stating that the IMPLICIT NONE disallows the implicitly typed 
> interface body and and a second error message reporting a conflict between 
> the interface body and and the module function in the submodule.  This is 
> the behavior I would hope would be the intention of the standard, but I’m 
> not certain it is the standard behavior.
> 
> The gfortran 6.1.0 compiler compiles the program without errors and prints 
> the following:
> 
> 9.18340949E-41  is not            1
> 
> The Intel 16.0 compiler compiles the program without errors and prints the 
> following:
> 
> 1.000000      is not            1
> 
> Despite my hopes, I suspect the interface body is standard-conforming on the 
> grounds that the IMPLICIT statement does not apply to the interface block. 
> Nonetheless, I suspect that  having an interface body that refers to a 
> procedure with the same names as a different procure in the a child 
> submodule makes the program non-conforming.
> 
> Damian
> 
> 
> module one_module
>  implicit none
>  interface
>    module function one()
>    end function
>  end interface
> end module
> 
> submodule(one_module) one_submodule
>  implicit none
> contains
>  integer module function one()
>    one = 1
>  end function
> end submodule
> 
> use one_module
> print *,one()," is not ",1
> end
> 
> 
> _______________________________________________
> J3 mailing list
> J3@mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star.
> ________________________________________________________________________ 
> 
> _______________________________________________
> J3 mailing list
> J3@mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

________________________________
Damian Rouson, Ph.D., P.E.
President, Sourcery Institute
http://www.sourceryinstitute.org
+1-510-600-2992 (mobile)



More information about the Fortran mailing list