From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27151 invoked by alias); 8 Apr 2008 01:41:38 -0000 Received: (qmail 26525 invoked by uid 48); 8 Apr 2008 01:40:55 -0000 Date: Tue, 08 Apr 2008 01:41:00 -0000 Subject: [Bug fortran/35865] New: Spurious warning for vector-valued functions passed as arguments X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "john dot young at jrc dot co dot jp" 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: 2008-04/txt/msg00578.txt.bz2 In the code below, the following warning is produced "Waring: Actual argument contains too few elements for dummy argument 'func' (1/3) at (1)" If the function result is changed to a scalar instead of a vector, no warning is produced. I do not know the standard well enough to know if this is a problem, but other compilers (G95,Intel) do not produce a warning. The function arguments do match however. I obtained this from "GCC 4.3.0 20080212 (experimental) [trunk revision 132252]" using cygwin under WinXP. !=============================================== module vec_func implicit none contains !=============================================== !=============================================== !function vector_func(func,r1) result(res) function vector_func(func) result(res) implicit none interface function func(r) result(res) implicit none real, intent(in) :: r real :: res(3) end function func end interface real :: res(3) res = func(0.) end function vector_func !============================== function test_func(r) result(res) implicit none real,intent(in) :: r real :: res(3) res = r end function test_func !========================================= end module vec_func !========================================= program a use vec_func implicit none real :: z(3) z = vector_func(test_func) print*, z end program a !========================================= -- Summary: Spurious warning for vector-valued functions passed as arguments Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: john dot young at jrc dot co dot jp GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35865