2 ! This should compile. There was a bug in resolving c_f_pointer that was
3 ! caused by not sorting the actual args to match the order of the formal args.
6 FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
9 TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
10 CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
12 FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen")
14 TYPE(C_PTR), VALUE :: string ! A C pointer
18 CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
19 END FUNCTION C_F_STRING