public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/49586] New: Multiple initialization with DATA: Warning and initialization order
Date: Thu, 30 Jun 2011 06:53:00 -0000	[thread overview]
Message-ID: <bug-49586-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2011-06-30  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30  6:53 burnus at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49586-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).