public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49586] New: Multiple initialization with DATA: Warning and initialization order
@ 2011-06-30  6:53 burnus at gcc dot gnu.org
  2011-06-30  7:01 ` [Bug fortran/49586] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-30  6:53 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: burnus@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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-16 18:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30  6:53 [Bug fortran/49586] New: Multiple initialization with DATA: Warning and initialization order burnus at gcc dot gnu.org
2011-06-30  7:01 ` [Bug fortran/49586] " jakub at gcc dot gnu.org
2011-06-30 11:43 ` jakub at gcc dot gnu.org
2011-06-30 12:31 ` jakub at gcc dot gnu.org
2011-06-30 13:58 ` burnus at gcc dot gnu.org
2011-06-30 16:11 ` jakub at gcc dot gnu.org
2011-06-30 17:29 ` dominiq at lps dot ens.fr
2013-06-16 18:15 ` dominiq at lps dot ens.fr
2013-06-16 18:15 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).