From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4108 invoked by alias); 18 Oct 2011 12:04:33 -0000 Received: (qmail 4092 invoked by uid 22791); 18 Oct 2011 12:04:32 -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; Tue, 18 Oct 2011 12:04:15 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47023] C_Sizeof: Rejects valid code Date: Tue, 18 Oct 2011 12:04:00 -0000 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: janus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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 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-10/txt/msg01791.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023 --- Comment #19 from janus at gcc dot gnu.org 2011-10-18 12:03:58 UTC --- (In reply to comment #18) > > * reject proc-pointers for SIZEOF (comment #7) Example: use iso_c_binding procedure(real), pointer :: pp procedure(real) :: proc pp => sin print *,sizeof(proc) ! (1) print *,sizeof(pp) ! (2) print *,sizeof(pp(0.)) ! (3) end Currently this gives the output: 1 1 4 The last one is correct, giving the size of the return value of the called function. The first one should eventually be rejected. For the second one, it's not completely clear where the '1' comes from, but it's certainly wrong (in any possible interpretation).