2 ! { dg-options "-Wno-c-binding-type" }
4 ! That's a copy of "bind_c_usage_8.f03", "bind_c_dts_4.f03",
5 ! "bind_c_implicit_vars.f03" and "c_kind_tests_2.f03"
6 ! to check that with -Wno-c-binding-type no warning is printed.
12 CHARACTER(C_CHAR
), DIMENSION(1), SAVE, TARGET
, PRIVATE
:: dummy_string
="?"
14 FUNCTION C_F_STRING(CPTR
) RESULT(FPTR
)
15 use, intrinsic :: iso_c_binding
16 TYPE(C_PTR
), INTENT(IN
) :: CPTR
! The C address
17 CHARACTER(KIND
=C_CHAR
), DIMENSION(:), POINTER :: FPTR
19 FUNCTION strlen(string
) RESULT(len
) BIND(C
,NAME
="strlen")
21 TYPE(C_PTR
), VALUE
:: string
! A C pointer
24 CALL C_F_POINTER(FPTR
=FPTR
, CPTR
=CPTR
, SHAPE
=[strlen(CPTR
)])
26 END MODULE ISO_C_UTILITIES
29 use iso_c_binding
, only
: c_int
33 type(foo
), bind(c
) :: cp
36 module bind_c_implicit_vars
41 subroutine sub0(i
) bind(c
)
44 end module bind_c_implicit_vars
47 use, intrinsic :: iso_c_binding
49 integer, parameter :: myF
= c_float
50 real(myF
), bind(c
) :: myCFloat
51 integer(myF
), bind(c
) :: myCInt
! { dg-warning "is for type REAL" }
52 integer(c_double
), bind(c
) :: myCInt2
! { dg-warning "is for type REAL" }
54 integer, parameter :: myI
= c_int
55 real(myI
) :: myReal
! { dg-warning "is for type INTEGER" }
56 real(myI
), bind(c
) :: myCFloat2
! { dg-warning "is for type INTEGER" }
57 real(4), bind(c
) :: myFloat
58 end module c_kind_tests_2