2 ! verify that the compiler catches the error in the call to c_f_pointer
3 ! because it is missing the required SHAPE parameter. the SHAPE parameter
4 ! is optional, in general, but must exist if given a fortran pointer
5 ! to a non-zero rank object. --Rickett, 09.26.06
6 module c_f_pointer_shape_test
8 subroutine test_0(myAssumedArray
, cPtr
)
9 use, intrinsic :: iso_c_binding
10 integer, dimension(*) :: myAssumedArray
11 integer, dimension(:), pointer :: myArrayPtr
12 integer, dimension(1:2), target
:: myArray
13 type(c_ptr
), value
:: cPtr
16 call c_f_pointer(cPtr
, myArrayPtr
) ! { dg-error "Missing SHAPE parameter" }
18 end module c_f_pointer_shape_test