This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50269] New: Wrongly rejects element of assumed-shape array in C_LOC
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Sep 2011 19:38:38 +0000
- Subject: [Bug fortran/50269] New: Wrongly rejects element of assumed-shape array in C_LOC
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: burnus@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