This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/59411] New: Problem with TYPE(C_PTR) constant initialization
- From: "mrestelli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Dec 2013 16:39:32 +0000
- Subject: [Bug fortran/59411] New: Problem with TYPE(C_PTR) constant initialization
- Auto-submitted: auto-generated
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