This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27989] New: -fbounds-check should check for too small arrays on subroutine calls
- From: "tobias dot burnus at physik dot fu-berlin dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jun 2006 12:51:50 -0000
- Subject: [Bug fortran/27989] New: -fbounds-check should check for too small arrays on subroutine calls
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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