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/59411] New: Problem with TYPE(C_PTR) constant initialization


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

            Bug ID: 59411
           Summary: Problem with TYPE(C_PTR) constant initialization
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrestelli at gmail dot com

Hi all,
   the attached code does not compile:

gfortran -c cst.f90 
cst.f90:6.31:

 type(c_ptr), parameter :: p2 = pp
                               1
Error: non-constant initialization expression at (1)

However, as far as I can tell, the code is correct (ifort accepts it).


gfortran --version
GNU Fortran (GCC) 4.9.0 20130813 (experimental)



module m
 use iso_c_binding
 implicit none

 type(c_ptr), parameter :: pp = c_null_ptr ! this works
 type(c_ptr), parameter :: p2 = pp         ! this doesn't work

end module m


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