From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13996 invoked by alias); 18 Jan 2011 09:50:48 -0000 Received: (qmail 13986 invoked by uid 22791); 18 Jan 2011 09:50:47 -0000 X-SWARE-Spam-Status: No, hits=-2.9 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; Tue, 18 Jan 2011 09:50:40 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47339] New: Fortran 95: Reject namelist objects of non-constant size 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: Tue, 18 Jan 2011 10:31: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-01/txt/msg01753.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47339 Summary: Fortran 95: Reject namelist objects of non-constant size Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Fortran 95 contains at "5.4 NAMELIST statement": "Constraint: A namelist-group-object shall not be an array dummy argument with a nonconstant bound, a variable with nonconstant character length, an automatic object, a pointer, a variable of a type that has an ultimate component that is a pointer, or an allocatable array." However, the following programs is not rejected using "gfortran -std=f95 -pedantic": subroutine test1(n) character(len=n) :: str namelist /nml/ str end subroutine test1 Expected: An error as printed by g95: Error: Variable 'str' at (1) cannot have a variable length and be in a NAMELIST or as with NAG: Error: Namelist-group-object STR is an automatic object or as with PathScale: "STR" is a namelist-group-object, therefore it must not be typed as variable length character. Note: In Fortran 2003 (and 2008) the restriction has been lifted and only the following is left, which is properly diagnosed C574 (R553) A namelist-group-object shall not be an assumed-size array.