From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19558 invoked by alias); 26 May 2008 16:50:10 -0000 Received: (qmail 19155 invoked by uid 48); 26 May 2008 16:49:26 -0000 Date: Mon, 26 May 2008 16:50:00 -0000 Message-ID: <20080526164926.19154.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg01934.txt.bz2 ------- 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