public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47339] New: Fortran 95: Reject namelist objects of non-constant size
@ 2011-01-18 10:31 burnus at gcc dot gnu.org
  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
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-18 10:31 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2011-02-02 17:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 10:31 [Bug fortran/47339] New: Fortran 95: Reject namelist objects of non-constant size burnus at gcc dot gnu.org
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

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