From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 178EA3857C67; Wed, 25 Aug 2021 18:58:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 178EA3857C67 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: HCDVUuX0PfPcQGmeCQuD2ttParFVuVUcaYM1IWL2FIRufWeh55DhCfUvmkW5tZ33zT0dSRQuwC qLKqKZu2XGSAemApnWWQlI4k/MHHWVINTerq6xxL6EQPBlg8hEY4e1jLvhOwzrqLnw8oHmsRoO CwP+3wCLz34jO9K+Qk+zXtVgdSFoABTQy/8gSzohDpMPvhXcFAu2rsX6r3Vq9/OvSukoXdu7mN 98iwkxj0fDbdAndtxHEJ6eoSyMzFQS1EyeJNhbs3SzUmCaJuvg0k+1ZLgAf9SLK9/jcI1TrpfY jt50ynHIDdGvfI+CNFMAYyVS X-IronPort-AV: E=Sophos;i="5.84,351,1620720000"; d="scan'208";a="67609672" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 25 Aug 2021 10:58:10 -0800 IronPort-SDR: iIWWHpMrokCmQjw+SLOBYJz2gDvaCzalKxUAt09YjUU8KNwm17wHIF6D9A6iQ1pJ1jhI2R8uj/ Xa57Sx4SC3k+WNs8FmtOTOPlzU9wGOCtphJSHspfsFQq1knCaUJLIP33iEE4H6hjSJgEuHtpBK EjVsDrL6mZDtXBe/j95V+oIZLCRsznATThXoJtiZ5dse94fQdSkVdVjBXnS2/vutfAb4WoaCfD vnO0CcQ3NauIqfTjsDjH/SdfCafYbb24joozyPJfBrAC35WTc+swVHSUUWGB7pTsRM17SrEUDq +2s= Subject: =?UTF-8?B?KlBJTkcqIOKAkyBSZTogW1BhdGNoXSBGb3J0cmFuOiBGaXggQmluZChD?= =?UTF-8?Q?=29_char-len_check=2c_add_ptr-contiguous_check?= From: Tobias Burnus To: gcc-patches , fortran , Sandra Loosemore References: Message-ID: Date: Wed, 25 Aug 2021 20:58:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 18:58:12 -0000 Early *PING*. (I also should still review several Fortan patches... There are lots of patches waiting for review :-/) On 20.08.21 19:24, Tobias Burnus wrote: > The following is about interoperability (BIND(C)) only. > > > * The patch adds a missing check for pointer + contiguous. > (Rejected to avoid copy-in issues? Or checking issues?) > > > * And it corrects an issue regarding len > 1 characters. While > > subroutine foo(x) > character(len=3D2) :: x(*) > > is valid Fortran code (the argument can be "abce" or ['a','b','c','d'] > or ...) > =E2=80=93 and would work also with bind(C) as the len=3D2 does not need t= o be > passed > as hidden argument as len is a constant. > However, it is not valid nonetheless. > > > OK? Comments? > > Tobias > > > PS: Referenced locations in the standard (F2018): > > C1554 If proc-language-binding-spec is specified for a procedure, > each of its dummy arguments shall be an interoperable procedure (18.3.6) > or a variable that is interoperable (18.3.4, 18.3.5), assumed-shape, > assumed-rank, assumed-type, of type CHARACTER with assumed length, > or that has the ALLOCATABLE or POINTER attribute. > > 18.3.1: "... 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 it > is of type character12its length is not assumed or declared by > an expression that is not a constant expression." > > 18.3.5: Likewise but for arrays. > > 18.3.6 "... Fortran procedure interface is interoperable with a C > function prototype ..." > "(5) any dummy argument without the VALUE attribute corresponds > to a formal parameter of the prototype that is of a pointer type, > and either > =E2=80=A2 the dummy argument is interoperable with an entity of the > referenced type ..." > (Remark: those are passed as byte stream) > "=E2=80=A2 the dummy argument is a nonallocatable nonpointer variabl= e of > type > CHARACTER with assumed character length and the formal > parameter is > a pointer to CFI_cdesc_t, > =E2=80=A2 the dummy argument is allocatable, assumed-shape, > assumed-rank, or > a pointer without the CONTIGUOUS attribute, and the formal > parameter > is a pointer to CFI_cdesc_t, or > (Remark: those two use an array descriptor, also for > explicit-size/assumed-size > arrays or for scalars.) > =E2=80=A2 the dummy argument is assumed-type ..." > ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955