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/47339] New: Fortran 95: Reject namelist objects of non-constant size
Date: Tue, 18 Jan 2011 10:31:00 -0000	[thread overview]
Message-ID: <bug-47339-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2011-01-18  9:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 10:31 burnus at gcc dot gnu.org [this message]
2011-01-18 12:59 ` [Bug fortran/47339] Fortran 2003/2008: Valid NAMELIST rejected; Fortran 95: Invalid namelist objects accepted burnus at gcc dot gnu.org
2011-01-18 13:10 ` burnus at gcc dot gnu.org
2011-01-18 13:43 ` burnus at gcc dot gnu.org
2011-01-22 22:37 ` burnus at gcc dot gnu.org
2011-01-26 10:26 ` burnus at gcc dot gnu.org
2011-02-02 17:57 ` dnovillo at gcc dot gnu.org

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-47339-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).