http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50269
Bug #: 50269 Summary: Wrongly rejects element of assumed-shape array in C_LOC Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: bur...@gcc.gnu.org Reported by Ian Bush in comp.lang.fortran, http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/71338937cf348f26 b = c_loc( aa( 1 ) ) 1 Error: Assumed-shape array 'aa' at (1) cannot be an argument to the procedure 'c_loc' because it is not C interoperable Program gf Use iso_c_binding Real( c_double ), Dimension( 1:10 ), Target :: a Call test( a ) Contains Subroutine test( aa ) Real( c_double ), Dimension( : ), Target :: aa Type( c_ptr ), Pointer :: b b = c_loc( aa( 1 ) ) End Subroutine test End Program gf