From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15207 invoked by alias); 22 Dec 2010 10:28:39 -0000 Received: (qmail 15198 invoked by uid 22791); 22 Dec 2010 10:28:38 -0000 X-SWARE-Spam-Status: No, hits=-2.9 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, 22 Dec 2010 10:28:34 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47023] C_Sizeof: Rejects valid code 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: 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, 22 Dec 2010 10:28: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-12/txt/msg02485.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu.org --- Comment #1 from Tobias Burnus 2010-12-22 10:28:28 UTC --- The reason for rejecting it is: if (verify_c_interop (&arg->ts) != SUCCESS) { gfc_error ("'%s' argument of '%s' intrinsic at %L must be be an " "interoperable data entity", If one looks at decl.c, one see that the check makes only sense for BT_DERIVED - but not for intrinsic variables. In decl.c one afterwards prints only an error for BT_DERIVED - otherwise only a warning is printed (which does not make sense here). And there is additionally a check for string-length == 1. * * * In decl.c, I think one should additionally check for BT_CLASS and reject the following program (currently there is just a "may not be C interoperable" warning as it is not BT_DERIVED). module m use iso_c_binding type t integer(c_int) :: i end type t contains subroutine test(a) bind(c) class(t) :: a end subroutine end