This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/15031] New: [gfortran] initialization expressions impose ordering restrictions


SUBROUTINE a(b)
   INTEGER :: c = SIZE(b)
   REAL :: b(5)
END SUBROUTINE
gives an error when compiled, 
[tobi@marktplatz src]$ gcc/build/gcc/f951 < t.f90
Warning: Reading file  as free form
        .file   "<stdin>"
 In file :2

  INTEGER :: c = SIZE(b)
                     1
Error: 'array' argument of 'size' intrinsic at (1) must be an array

This is unjustified, I believe, ordering of declarations shouldn't affect the
validity of initializations. ifc compiles this without an error. The relevant
section in the (draft) Fortran 95 standard is 7.1.6.1, no. (7) under
initialization expression.

-- 
           Summary: [gfortran] initialization expressions impose ordering
                    restrictions
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Tobias dot Schlueter at physik dot uni-muenchen dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15031


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]