This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36759] New: C_LOC and characters greater then one in length.
- From: "brtnfld at hdfgroup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2008 21:44:07 -0000
- Subject: [Bug fortran/36759] New: C_LOC and characters greater then one in length.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When I compile the code:
PROGRAM main
USE, INTRINSIC :: ISO_C_BINDING
IMPLICIT NONE
CHARACTER(LEN=2), TARGET :: arg1 = '12'
TYPE(c_ptr) :: A
A = c_loc(arg1)
END PROGRAM main
I get the error:
A = c_loc(arg1)
1
Error: CHARACTER argument 'arg1' to 'c_loc' at (1) must have a length of 1
I'm not sure where this restriction comes from (it's not part of the standard).
All the other fortran compilers (at least g95, ifort, and pgf90) support
character LEN >1. Actually they support CHARACTER(LEN=*) when declared in a
subroutine.
--
Summary: C_LOC and characters greater then one in length.
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: brtnfld at hdfgroup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36759