This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36759] 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: 9 Jul 2008 14:24:58 -0000
- Subject: [Bug fortran/36759] C_LOC and characters greater then one in length.
- References: <bug-36759-16432@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from brtnfld at hdfgroup dot org 2008-07-09 14:24 -------
The behavior conforms to the standard:
For the C_LOC(X) function X must be interpretable and interpretable for a
character the standard says:
15.2.1 Interoperability of intrinsic types
A Fortran intrinsic
4 type with particular type parameter values is interoperable with a C type if
the type and kind type
5 parameter value are listed in the table on the same row as that C type; if
the type is character, inter
6 operability also requires that the length type parameter be omitted or be
specified by an initialization
7 expression whose value is one.
so it conforms to the standard by requiring
CHARACTER(LEN=1, KIND=C_CHAR), TARGET :: chr(2)
or
CHARACTER(KIND=C_CHAR), TARGET :: chr(2)
--
brtnfld at hdfgroup dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36759