This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute
- 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: 26 May 2008 16:49:26 -0000
- Subject: [Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute
- References: <bug-36325-14773@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from burnus at gcc dot gnu dot org 2008-05-26 16:49 -------
(In reply to comment #8)
> So we're left with gomp/reduction3.f90, which contains this piece of code:
> interface
> function ior (a, b)
> intrinsic ior
>
> This produces:
> Error: EXTERNAL attribute conflicts with INTRINSIC attribute at (1)
"C518 An entity shall not have both the EXTERNAL attribute and the INTRINSIC
attribute."
For INTRINSIC one finds also the following, which lifts a related restriction.
"A name that identifies a specific intrinsic function in a scoping unit has a
type as specified in 13.6. An explicit type declaration statement is not
required; however, it is permitted. Specifying a type for a generic intrinsic
function name in a type declaration statement is not sufficient, by itself, to
remove the generic properties from that function."
However, I believe that only means that besides "intrinsic sin" also "real,
intrinsic :: sin" is allows.
I tested the failing interface+intrinsic and all my compilers but gfortran
reject it: ifort, NAG f95, g95, openf95, sunf95.
> I haven't checked the standard on this, but I bet the code is illegal.
I agree.
> And after all: Why should one declare an explicit interface for an intrinsic
> (whose interface is known anyway) ...?
Good question for which I do not know the answer.
But also for "real, intrinsic :: " I don't know the answer, but it is allowed.
(One difference is that one has not the intrinsic vs. external conflict and
that old Fortran programs used it (probably incl. implicit typing). INTERFACE
is F90 and there one wanted to be stricter.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36325