From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28244 invoked by alias); 14 Oct 2010 17:15:07 -0000 Received: (qmail 28194 invoked by uid 22791); 14 Oct 2010 17:15:04 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID 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; Thu, 14 Oct 2010 17:15:00 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic 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: 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: Thu, 14 Oct 2010 17:15: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: 2010-10/txt/msg01217.txt.bz2 Message-ID: <20101014171500.C7tYuqwUjspVvrAcvL7IS-T8Ai35CGvPbGbt3Z7C4Vw@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46020 --- Comment #1 from Tobias Burnus 2010-10-14 17:14:45 UTC --- Thinking of it again, one probably needs also NAGs error message as: FUNCTION F_X(A) bind(c,name='F_X') CHARACTER*(*) F_X END FUNCTION ... interface FUNCTION F_X(A) bind(c,name='F_X') CHARACTER*(1) F_X END FUNCTION end interface is also invalid - even though the effective string length is one; F2008 has: "If the type is character, the length type parameter is interoperable if and only if its value is one." [...] [only interoperable] "if it is of type character its length is not assumed or declared by an expression that is not a constant expression." Thus, one could think of handling the assumed length case explicitly. Or one uses, e.g. Error: Return type of BIND(C) function 'f_x' at (1) of character type must have length 1