On Fri, 12 Nov 2021 23:23:24 +0100 Harald Anlauf <anl...@gmx.de> wrote:
> F2008:15.3.5 relaxed the condition on interoperable character variables > and now allows values different from one. Similar text in F2018:18.3.4. > This required an adjustment in the interoperability check. In N2146 i see though F2018:18.3.2 Interoperability of intrinsic types p1: ... If the type is character, the length type parameter is interoperable if and only if its value is one. So it seems the 'one' constraint just was moved ? > There'll be a way to resolve this PR. Maybe Tobias or Thomas have > an opinion. There are strange ways in the standard anyway to pass > Fortran character strings to BIND(C) procedures. Look e.g. at > "5.5.2.11 Sequence association" which sort of hacks this situation > for some applications relevant to me. Yes. I think you refer to 15.5.2.11 (15, not 5) NOTE 18.21 contains a sample CHARACTER(LEN=10, KIND=C_CHAR) :: & & DIGIT_STRING = C_CHAR_’123456789’ // C_NULL_CHAR where, if i read this correctly, the interoperability is laundered by "These correspond to character array dummy arguments in the procedure interface body as allowed by Fortran’s rules of sequence association (15.5.2.11)" The reasoning seems to be that the LEN=10 in this context is a mere array initializer for an array(10) and hence a "10 times LEN=1", thus fine?