https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107266
--- Comment #12 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Tue, Oct 18, 2022 at 05:29:58PM +0000, sgk at troutmask dot apl.washington.edu wrote: > > % gfcx -c -std=f2018 a.f90 > a.f90:1:30: > > 1 | character(kind=4) function bar(x, y, z) bind(C) > | 1 > Error: GNU Extension: Symbol 'bar' at (1) with type CHARACTER(KIND=4) cannot > have the BIND(C) attribute > > The patch checks a *function* result variable for an interoperable > CHARACTER kind. > BTW, Fortran standard contains C1553 If proc-language-binding-spec is specified for a function, the function result shall be an interoperable scalar variable. So, accepting "character(kind=4) foo() bind(c)" is questionable (unless kind=4 is C_CHAR, which it isn't).