[Bug fortran/27989] New: -fbounds-check should check for too small arrays on subroutine calls
tobias dot burnus at physik dot fu-berlin dot de
gcc-bugzilla@gcc.gnu.org
Sun Jun 11 13:10:00 GMT 2006
This is with GNU Fortran 95 (GCC) 4.2.0 20060608 (experimental) and 4.1.0 (SUSE
Linux).
The following program has a problem as the passed array is shorter than the
array expected by the subroutine. Currently, gfortran does not detect this
problem.
Expected: Something like
Actual argument for dummy array A too small - 3 elements instead of 5
(this is the NAG -C=all output)
----------<cut>-----------
program test
implicit none
real :: b(3)
b = 42.0
call sub(5,b)
end program test
subroutine sub(n,a)
implicit none
integer, intent(in) :: n
real, intent(in) :: a(n)
print *,a
end subroutine sub
-------<cut>----------------
--
Summary: -fbounds-check should check for too small arrays on
subroutine calls
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tobias dot burnus at physik dot fu-berlin dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27989
More information about the Gcc-bugs
mailing list