From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D32833858D32; Tue, 18 Oct 2022 17:29:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D32833858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666114198; bh=r32RtY3jn3qNb9EZi2xS3h41dqZcdepOGq/l2zjn9Ug=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rzedoSqjJDOv4t6hNhayPf1zTPmfBd7f2Nk2OCPGzkTqlhEmf7ypMj//A+0oziyaK g/X7Gg0MXitvQKcd00uBLNVqrRd3GiaLEX0Ee5gSua78750Gi3dk+CPEyeT1icfzF0 hWRD4OTglM+rUdMequBj47e/++sFELa6YjriNuj4= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBmb3J0cmFuLzEwNzI2Nl0gUmVqZWN0IGtpbmQ9NCBjaGFy?= =?UTF-8?B?YWN0ZXJzIGZvciBCSU5EKEMpIOKAkyBpdCBpbnZhbGlkIGFuZCBnZW5lcmF0?= =?UTF-8?B?ZXMgd3JvbmcgY29kZQ==?= Date: Tue, 18 Oct 2022 17:29:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: accepts-invalid, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107266 --- Comment #11 from Steve Kargl = --- On Tue, Oct 18, 2022 at 10:40:59AM +0000, burnus at gcc dot gnu.org wrote: >=20 > (b) subroutine bar(x, y, z) bind(C) > character(kind=3D4,len=3D*) :: x > character(kind=3D4) :: y(:) > character(kind=3D4), allocatable :: z >=20 > This one is valid as F2018's "18.3.6 Interoperability of procedures and > procedure interfaces" states: I'm going to assume that you did not compile the above, or read the patch. % gfcx -c a.f90 a.f90:1:22: 1 | subroutine bar(x, y, z) bind(C) | 1 Error: Allocatable character dummy argument 'z' at (1) must have deferred length as procedure 'bar' is BIND(C) % cat a.f90 subroutine bar(x, y, z) bind(C) character(kind=3D4,len=3D*) :: x character(kind=3D4) :: y(:) character(kind=3D4,len=3D:), allocatable :: z end subroutine bar % gfcx -c a.f90 && nm a.o | grep bar 0000000000000000 T bar % gfcx -c -std=3Df2018 a.f90 && nm a.o | grep bar 0000000000000000 T bar % cat a.f90=20 character(kind=3D4) function bar(x, y, z) bind(C) character(kind=3D4,len=3D*) :: x character(kind=3D4) :: y(:) character(kind=3D4,len=3D:), allocatable :: z end function bar % gfcx -c a.f90 && nm a.o | grep bar 0000000000000000 T bar % gfcx -c -std=3Df2018 a.f90 a.f90:1:30: 1 | character(kind=3D4) function bar(x, y, z) bind(C) | 1 Error: GNU Extension: Symbol 'bar' at (1) with type CHARACTER(KIND=3D4) can= not have the BIND(C) attribute The patch checks a *function* result variable for an interoperable CHARACTER kind.=