subroutine aaa(in) use iso_c_binding implicit none CHARACTER(KIND=C_CHAR), DIMENSION(*), TARGET :: in type(c_ptr) :: cptr cptr = c_loc(in) end subroutine
Wrongly rejected with: Error: CHARACTER argument 'in' to 'c_loc' at (1) must have a length of 1 subroutine aaa(in) use iso_c_binding implicit none integer(KIND=C_int), DIMENSION(:), TARGET :: in type(c_ptr) :: cptr cptr = c_loc(in) end subroutine Wrongly accepts this; NAG f95 writes: Error: aa.f90, line 6: The argument to C_LOC must not be an assumed-shape array -- Summary: ISO C Binding: C_LOC argument checking needs improvement Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: rejects-valid, accepts-invalid 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=32804