This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32315] New: DATA with implied-do: Bounds checks missing


Found at:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/34f509b6b4241c6d/

program chkdata
    character(len=20), dimension(4) :: string
    data ( string(i) ,i=1,5 ) / &
        'A', 'B', 'C', 'D', 'E' /
    write(*,*) string
end program chkdata

gfortran gives no warning/error whereas NAG f95 rejects it with:
  Error line 5: First subscript (5) is greater than upper bound (4)
  for array STRING
and g95 rejects it with:
  Error: Out of bounds array reference at (1)
and sunf95 with:
  ERROR: The upper bound for dimension 1 of the array STRING is out of range.

(ifort does the same as gfortran: It accepts it.)


-- 
           Summary: DATA with implied-do: Bounds checks missing
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32315


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]