[Bug fortran/36759] C_LOC and characters greater then one in length.
brtnfld at hdfgroup dot org
gcc-bugzilla@gcc.gnu.org
Wed Jul 9 14:25:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list