------- Comment #1 from burnus at gcc dot gnu dot org 2007-07-02 23:09 ------- Analogously for c_f_pointer (without SHAPE) and c_f_funpointer:
use iso_c_binding implicit none integer, target :: tgt type(c_ptr) :: cptr integer, pointer :: ptr cptr = c_loc(tgt) call c_f_pointer(cptr,ptr) end gfortran: c_f_pointer_i4 (cptr, &ptr, 0B); g95: ptr = cptr;; NAG f95: ptr_ = cptr_; For shape, one can also consider generate the code directly. gfortran and g95 call a library function but NAG f95 generates the C code directly: use iso_c_binding implicit none integer, target :: tgt(10) type(c_ptr) :: cptr integer, pointer :: ptr(:) cptr = c_loc(tgt) call c_f_pointer(cptr,ptr, (/ 10 /)) end -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32600