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


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to mrestelli from comment #0)
> 
>  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).

well, just because ifort accepts it doesn't mean that it's valid.

In fact the corresponing case with actual Fortran pointers (i.e. pointer
initialization) is only allowed since F08, cf. PR45290. One should check the
Fortran standard for restrictions in the case of C_PTRs (which, strictly
speaking, are no actual pointers in the Fortran sense).


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