[Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jul 17 20:23:00 GMT 2007
The following fails if the FPTR argument is not the second argument.
The argument checking should be based on the ordered argument list not on the
position of the call ("FPTR=" is not always at the second position).
(Related to PR32797)
CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
1
Error: Argument 'cptr' to 'c_f_pointer' at (1) must have the POINTER attribute
FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
USE ISO_C_BINDING
implicit none
TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
INTERFACE
FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen")
import
TYPE(C_PTR), VALUE :: string ! A C pointer
integer(c_int) :: len
END FUNCTION
END INTERFACE
CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
END FUNCTION
--
Summary: ISO Bind C: C_F_Pointer argument bogus checking
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32630
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32800
More information about the Gcc-bugs
mailing list