From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E93651F47C for ; Wed, 25 Jan 2023 22:01:01 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=78364E5A-2AF3-11ED-87FA-8298ECA2D365 header.b=K3PqzuRy; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKnp3-0006B0-5N; Wed, 25 Jan 2023 17:00:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKnoi-00069r-6a; Wed, 25 Jan 2023 17:00:28 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKnof-0000uM-Tb; Wed, 25 Jan 2023 17:00:27 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 13CE3160048; Wed, 25 Jan 2023 14:00:23 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id IbYW9D8mpvrs; Wed, 25 Jan 2023 14:00:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1229E160054; Wed, 25 Jan 2023 14:00:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 1229E160054 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1674684022; bh=F16lw3rAcEnmy8rsjMjBWVEEmXItPUct9V7gvYxiWGY=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type: Content-Transfer-Encoding; b=K3PqzuRyLISScl8gHBY61+DFbZh0tmydwZ/qAWOkfTSYWy7Fo0MzEjg2ve79oLF1K UFR9EEPx9u4vhYyUBbh3KRipDYkXTeViQRnagCwlOlp6sJ7cZry3EGgK45sqUKtzKF 14risWTkJs4HADzsZXaaWfXc+VKXlLgH/WpD+aNA= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qAJJau-f-BNo; Wed, 25 Jan 2023 14:00:21 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D7343160040; Wed, 25 Jan 2023 14:00:21 -0800 (PST) Message-ID: <66302311-fded-4403-525e-cfa2a9cfde64@cs.ucla.edu> Date: Wed, 25 Jan 2023 14:00:21 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: Bruno Haible , bug-gnulib@gnu.org, epsilon-devel@gnu.org Cc: poke-devel@gnu.org References: <2093695.QfOb2KXJ6Q@nimes> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: Keep config.h idempotent In-Reply-To: <2093695.QfOb2KXJ6Q@nimes> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org On 2023-01-25 06:05, Bruno Haible wrote: > What happens, is that this compilation unit #includes five times, > and somewhere between the first and the fifth inclusion, poke's code does > #define returns_nonnull > > This is their particular way of not emitting this particular GCC/clang > attribute, and is OK since 'returns_nonnull' is not a keyword and not a > token in the reserved namespace. Is this diagnosis correct? It appears to me that poke 2.90.1's "#define returns_nonnull" is not a problem, because the Gnulib code never uses that identifier. Instead, the Gnulib code does this: #if _GL_HAS_ATTRIBUTE (returns_nonnull) which uses this macro: # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) and so has the same effect as this: #if __has_attribute (__returns_nonnull__) regardless of what returns_nonnull was defined to, because C doesn't macro-expand immediate operands of ##. If I understand things correctly the problem with poke 2.90.1 wasn't its "#define returns_nonnull"; it was its "#define __returns_nonnull__", which indeed defines a token in the reserved namespace. > Hence this sequence > > #include > #define returns_nonnull > #include > > is supposed to work fine. Isn't there still a problem with something like the following, even with the latest Gnulib? #define __returns_nonnull__ #include That is, it seems to me that the real problem here is a collision with poke's "#define __returns_nonnull__" before , not with including twice. Obviously we can't make Gnulib immune to arbitrary #defines of reserved names. This is not to say that we shouldn't accommodate GNU poke, just that it's not clear that the cure is right here, as a general rule. More generally, I don't think Gnulib should imply to users that it's OK to include twice. That's an uncommon practice and is a recipe for trouble, as too many programs do fun stuff in their configure.ac that Gnulib has no control over. Instead, we should clarify Gnulib's documentation to say that compilation units should include first, before including anything else, and should not include later.