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

           Summary: Multiple initialization with DATA: Warning and
                    initialization order
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
        Depends on: 49540


Follow up to PR 49540.

gfortran - as some other compilers - allows multiple initialization in DATA
statements.

Expected:
- Warn - at least with -Wall - if multiple initialization occur
  (Currently, only -pedantic warns and -std=f* prints an error)
- Check whether the current initialization makes sense
  I think the version of gfortran 4.1 + the commercial compilers makes most
  sense.


For the test case below, the result is (* = warns by default):

- g95, NAG: Error because of multiple initialization

- gfortran 4.1 (!), ifort, sunf90, pathf90*, openf90*, pgf90:
4, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 6

- gfortran 4.6 and 4.7:
4, 5, 5, 5, 5,  1, 2, 2, 2, 3,  5, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 6

- gfortran 4.3, 4.4 and 4.5:
4, 3, 3, 3, 3,  3, 3, 3, 3, 3,  3, 3, 3, 3, 3,  3, 3, 3, 3, 3,  3, 3, 3, 3, 6


      program pr49540_2
        common /a/ i(5,5)
        data i(1:5,2) /1, 3 * 2, 3/
        data i /4, 23 * 5, 6/
        print '(5(5(i0:", "):" "))', i
      end

Reply via email to