From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id B5B253858C53 for ; Sun, 19 Mar 2023 19:38:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5B253858C53 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pdyr0-0003cd-La for gcc-patches@gcc.gnu.org; Sun, 19 Mar 2023 20:38:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: procedures with BIND(C) attribute require explicit interface [PR85877] Date: Sun, 19 Mar 2023 20:38:02 +0100 Message-ID: References: <3496724e-5ebd-d133-c6f6-807068b175f4@netcologne.de> <56697d6e-7fe1-cb94-125e-7f9828be5d15@netcologne.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US In-Reply-To: <56697d6e-7fe1-cb94-125e-7f9828be5d15@netcologne.de> Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20230319193802.I3_AIFTCy_BtK_qPf8G_cN_IvOH2xjw2hlv_jDRWhiQ@z> Hi Thomas, Am 19.03.23 um 08:34 schrieb Thomas Koenig via Gcc-patches: > Hi Harald, > >> Am 18.03.23 um 19:52 schrieb Thomas Koenig via Gcc-patches: >>> Hi Harald, >>> >>>> the Fortran standard requires an explicit procedure interface in >>>> certain >>>> situations, such as when they have a BIND(C) attribute >>>> (F2018:15.4.2.2). >>>> The attached patch adds a check for this. >>>> >>>> Regtested on x86_64-pc-linux-gnu.  OK for mainline? >>> >>> While this fixes the ICE, it misses >>> >>> function f() bind(c) >>>    f = 42. >>> end >>> >>> subroutine p >>>    bind(c) f     ! { dg-error "must be explicit" } >>>    x = f() >>> end >> >> what do you mean by "it misses"? > > Sorry, that was caused by confusion on my part (and it is better > to test an assumption of what the compiler actually does :-) > > Patch is OK, also for backport.  Maybe you can also include the > test above, just to make sure. I've added your suggestion to the testcase. Pushed as: https://gcc.gnu.org/g:5426ab34643d9e6502f3ee572891a03471fa33ed > Best regards > >     Thomas > > Thanks, Harald