Bug 30939 - Run-time check if dummy array sizes is larger than actual array size
Summary: Run-time check if dummy array sizes is larger than actual array size
Status: RESOLVED DUPLICATE of bug 27989
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks: Fortran_bounds_checking
  Show dependency treegraph
 
Reported: 2007-02-23 21:24 UTC by Tobias Burnus
Modified: 2010-05-19 17:53 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-03-18 18:07:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2007-02-23 21:24:28 UTC
NAG f95:
Error: bar.f90, line 6: Array supplied for dummy IN (no. 1) of COPY too small
g95:
Error: Array argument at (1) is smaller than the dummy size
gfortran: No error/warning.

--------------------------
program main
implicit none
character :: digit_arr(10)
call copy(digit_arr)
contains
  subroutine copy(in)
    character, dimension(11) :: in, out
  end subroutine copy
end program main
--------------------------

Note: The other way round is ok, i.e. actual = 1:10, dummy = 1:8
Comment 1 Francois-Xavier Coudert 2007-03-18 18:07:39 UTC
Related to -fbounds-check, isn't it?
Comment 2 Tobias Burnus 2007-07-04 07:19:22 UTC
> Related to -fbounds-check, isn't it?
As my initial bug is fixed:

Warnung: Actual argument contains too few elements for dummy argument 'in' (10/11) at (1)

and the missing parts are in PR30939, I dedicate it to the run time test.

Test: Place program and subroutine in different files, compile and run them. NAG f95 -C=all shows then:


Actual argument for dummy array IN too small -
10 elements instead of 11
Program terminated by fatal error
In COPY, line 1 of aa.f90
Called by MAIN, line 4 of ab.f90
Comment 3 Daniel Franke 2010-05-19 17:53:19 UTC
(In reply to comment #2)
> I dedicate it to the run time test.
> Test: Place program and subroutine in different files, compile and run them.
> NAG f95 -C=all shows then:

Same as PR27989.


*** This bug has been marked as a duplicate of 27989 ***