[Bug fortran/32600] [ISO Bind C] C_LOC/C_FUNLOC should not be library functions
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jul 2 23:10:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list