This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35865] New: Spurious warning for vector-valued functions passed as arguments
- From: "john dot young at jrc dot co dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Apr 2008 01:40:55 -0000
- Subject: [Bug fortran/35865] New: Spurious warning for vector-valued functions passed as arguments
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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