https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102368

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #5 from anlauf at gcc dot gnu.org ---
The relevant F2018 standard excerpts are:

18.2.3.7  C_SIZEOF (X)
[...]
Argument. X shall be an interoperable data entity ...

3.45  data entity
data object, result of the evaluation of an expression, or the result of
the execution of a function reference

3.46  data object
constant (7.1.4), variable (9), or subobject of a constant (5.4.3.2.4)

3.92  interoperable
⟨Fortran entity⟩ equivalent to an entity defined by or definable by the
companion processor (18.3)

18.3.1  Interoperability of intrinsic types

Table 18.2 shows the interoperability between Fortran intrinsic types and C
types.  A Fortran intrinsic type with particular type parameter values is
interoperable with a C type if the type and kind type parameter value are
listed in the table on the same row as that C type.  If the type is
character, the length type parameter is interoperable if and only if its
value is one. ...

18.3.4  Interoperability of scalar variables

A named scalar Fortran variable is interoperable if and only if its type
and type parameters are interoperable, [...], and if it is of type
character its length is not assumed or declared by an expression that is
not a constant expression.

An interoperable scalar Fortran variable is interoperable with a scalar C
entity if their types and type parameters are interoperable.


I understand Steve's comment that the length has to be constant and one.
If this is the common understanding, the current PR would be invalid.

Reply via email to