From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15031 invoked by alias); 6 Oct 2011 01:11:24 -0000 Received: (qmail 15021 invoked by uid 22791); 6 Oct 2011 01:11:23 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_VU 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, 06 Oct 2011 01:11:08 +0000 From: "john.harper at vuw dot ac.nz" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/44022] Spurious 'unused parameter' for a used procedure argument Date: Thu, 06 Oct 2011 01:11: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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: john.harper at vuw dot ac.nz X-Bugzilla-Status: NEW 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 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/msg00293.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44022 john.harper at vuw dot ac.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |john.harper at vuw dot | |ac.nz --- Comment #3 from john.harper at vuw dot ac.nz 2011-10-06 01:10:36 UTC --- This gfortran bug happens if the offending subprogram is after CONTAINS in a main program as well as in a module. With gfortran -Wall -W this program showed the bug but did print 3.000000 program test implicit none intrinsic sqrt print "(F10.6)",find(sqrt,9.0) contains real function find(func,x) ! gfortran -Wall -W warns unused parameter func real,external ::func real,intent(in):: x find = func(x) end function find end program test I used two versions: gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) and gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC). I would have installed version 4.6 if I could have. -- John Harper