From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [89.1.8.211]) by sourceware.org (Postfix) with ESMTPS id 7891B3858D28; Sat, 18 Mar 2023 18:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7891B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=netcologne.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=netcologne.de Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 2588912624; Sat, 18 Mar 2023 19:52:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1679165537; bh=WFJTb2N/UuB12AZqS0hMQVfmg0s0i81nURLUnJDrkqU=; h=Message-ID:Date:Subject:To:References:From:In-Reply-To:From; b=NXRkH34yqmPmnm2fl+QbRSzSNtirV0RY1FVBzlwn+IVKlFKw2tqshqJhr3FrQcZ55 9Fb/gitxqC+ZEbKY+FQaeS8OuuVH9ezDeFDp1V/8S7ygR3B8NEYQOuxM2mP0QfQE22 4blvVpvGLNNy9TPT0LNok7xp9PKb7I4AwXyvbjKH2RJPip6gdnJOR6MRLBg7EZnepG xkHNFXG+8G0cLJvEvScZaL+J4sTSC8MVu5fGb35Z5rK65YJA0v3durx5Qa+K5wPhw1 YCUnZcMoTEpLa3FU7gKhu4oVC9ErlKPd96V+qFgg8UXrYXoya5ohVeI0C4jYLzpkqs QUY2mau+Wg1HQ== Received: from [IPV6:2001:4dd6:4ac:0:7285:c2ff:fe6c:992d] (2001-4dd6-4ac-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd6:4ac:0:7285:c2ff:fe6c:992d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA id C53F211FA1; Sat, 18 Mar 2023 19:52:14 +0100 (CET) Message-ID: <3496724e-5ebd-d133-c6f6-807068b175f4@netcologne.de> Date: Sat, 18 Mar 2023 19:52:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] Fortran: procedures with BIND(C) attribute require explicit interface [PR85877] Content-Language: en-US To: Harald Anlauf , fortran , gcc-patches References: From: Thomas Koenig In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-NetCologne-Spam: L X-Spamd-Bar: - X-Rspamd-Action: no action X-Rspamd-Queue-Id: C53F211FA1 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 subroutine s interface function g() bind(c) end function g end interface x = g() end where the interface is picked up via a global symbol. This code may not be valid; nagfor rejects it, but I cannot find a constraint at least in the F2022 draft that prohibits it. Hm... might it be better to check for attr->module_procedure || attr->if_source == IFSRC_IFBODY? Best regards Thomas