This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2007 20:23:17 -0000
- Subject: [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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