From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27951 invoked by alias); 4 May 2011 08:24:31 -0000 Received: (qmail 27934 invoked by uid 22791); 4 May 2011 08:24:29 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 08:24:14 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/48858] Incorrect error for same binding label on two generic interface specifics X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 04 May 2011 08:24:00 -0000 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: 2011-05/txt/msg00276.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48858 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid CC| |burnus at gcc dot gnu.org --- Comment #2 from Tobias Burnus 2011-05-04 08:23:41 UTC --- (In reply to comment #0) > This code should compile. There is only one "entity" with the binding lablel > "Cfun". In the words in the standard, only one "entity of the program" with > this binding label. The names cfunc2 and cfunc1 are both local identifiers. > (Sections 16.2 and 16.3). > > This construction is specifically allowed in the standard to allow users to > call a C function with multiple interfaces, similar to what is illustrated > here. I think I have to re-read that standard; I once got the impression that it wasn't allowed to have two different interfaces pointing to the same entity. (In reply to comment #1) [BIND(C) with OPTIONAL arguments] > The Intel and PGI compilers already support this (no compile errors, correct > output). Having a correct output is probably not surprising as most Fortran compilers already handle OPTIONAL internally by passing a NULL pointer. Thus, also for gfortran it would only a few lines (allowing it unless -std=f95/f2003/f2008 is specified - and rejecting with BIND(C) the combination of OPTIONAL with VALUE). I was thinking of introducing an flag -std=f2008tr, which will allow F2008 with the two TR, which are being drafted: TR 29113 and the coarray TR. It's on my agenda (cf. PR 48820 and http://gcc.gnu.org/wiki/TR29113Status), but as it is a post-F2008 item, I thought I wait for the PDTR or FDTR and concentrate until then on, e.g., coarrays.