From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28100 invoked by alias); 30 Jun 2011 06:53:09 -0000 Received: (qmail 28071 invoked by uid 22791); 30 Jun 2011 06:53:08 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jun 2011 06:52:54 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49586] New: Multiple initialization with DATA: Warning and initialization order X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 30 Jun 2011 06:53:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02935.txt.bz2 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