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=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,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 3909D1F47C for ; Wed, 25 Jan 2023 23:49:33 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=VY46Capy; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKpVu-0006DB-JL; Wed, 25 Jan 2023 18:49:10 -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 1pKpVr-0006CY-Bl; Wed, 25 Jan 2023 18:49:07 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.160]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKpVo-0008Hn-Ok; Wed, 25 Jan 2023 18:49:07 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1674690529; cv=none; d=strato.com; s=strato-dkim-0002; b=o+kkvSLogtXDjNjra/YSD1cvXumqneLXcnyHzW1ujPfEuv7IuVTAVLyurla1UN76Xx +MXbJrH1Cp7uju+CP39ag45hY3Lv/delAir5SF+7aqSIdlGNViQFRkxbazX/o4zhtKLc OB4WSZxbgYDGGQZkzzQfVI6dst4rsPxSdXBTn683u+9Pt9BKVXpVEpOGuBTQEMdgp/RN r8JFpFoOeWjsKKVjIkg08wh+hvE6SBaxXj2iAPHxzcytUPjielONU1bWwuBBDhKy7toS 0oHrxz8LQb6dWX/4CLJPbbcYbKx1rKs+1lZq0EMPoUHl8zgMYWVtxuIDkiORYTvCh53s 7iHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1674690529; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=vs+eMkSiqWJgx3Dg3ErJt6YGSqRthVcY0prrRwqxL7I=; b=F7C99Yn3pVcx941dkG31KHYmt56oHljGRdVViLq0zijgMYUgl0MgjLC0We9f2WHYjf EhMwS1cizW2wZe1i362Ym3fAMlKOTx2ehBF2U2Xnl8/lk6dvrYVBsJYb3sYfb7yjMyTW wBZdiYUs9tIy0EmxpEGWaTwDaYekbZHnNlonKmUZDHtBiv9mcjy+6NImt/8RDdcKJfnT Cr+pCqghPZs10zN4N9pYe79rHX64XrbpvMutJ1BFk9fTdLEeG+f9DsqfKriL5ld7FPTK lIwDU8PQLrPcrxM+T9xr4s2SJP1/4vs7oqmgGV+t1igHtV9hpHMOVH3OQfq7hdkAclGI i7Lw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1674690529; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=vs+eMkSiqWJgx3Dg3ErJt6YGSqRthVcY0prrRwqxL7I=; b=VY46CapyFv5ngngSnlYuNCxpuNDDvUTVkVLS3VS1e3lQybFerDWSSoPf78ZuNrwZxQ Hu0IYI1qX/9gE2AkdxLf0Y5b9BWXKUmeRoHDKEBg6+a4Ayb9uhswmT63/bb8PFK6Aspz Sr1wmc4BDtYQckAluXF3hkTtu7fhWlachE8TbQa6KdcO/87Iln3MZ8T8Jt/9wbvfN6FL aHzHbbbS+zJvqXVz+szV0LFHBcXiTzOoS8ZwDp1N4XkH12IUUqfHKFHYY0EAQo9fDC6Z Gt41CtZCdsRh+9ktW0wzTFKTeU++oyEj9phVIr1ekzVk+TJ6St4zBOM3/Ka72ZLVEcu3 A93w== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPE3/AkhaePDzS2RsxjOA78fax83g==" Received: from nimes.localnet by smtp.strato.de (RZmta 49.2.2 AUTH) with ESMTPSA id 098542z0PNmmArq (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 26 Jan 2023 00:48:48 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org, epsilon-devel@gnu.org, Paul Eggert Cc: poke-devel@gnu.org Subject: Re: Keep config.h idempotent Date: Thu, 26 Jan 2023 00:48:48 +0100 Message-ID: <418965623.aKRZZrHkil@nimes> In-Reply-To: <66302311-fded-4403-525e-cfa2a9cfde64@cs.ucla.edu> References: <2093695.QfOb2KXJ6Q@nimes> <66302311-fded-4403-525e-cfa2a9cfde64@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Received-SPF: none client-ip=81.169.146.160; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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 Hi Paul, Luca, Paul Eggert wrote: > It appears to me that poke 2.90.1's "#define=20 > returns_nonnull" is not a problem, because the Gnulib code never uses=20 > that identifier. Instead, the Gnulib code does this: >=20 > #if _GL_HAS_ATTRIBUTE (returns_nonnull) >=20 > which uses this macro: >=20 > # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) >=20 > and so has the same effect as this: >=20 > #if __has_attribute (__returns_nonnull__) >=20 > regardless of what returns_nonnull was defined to, because C doesn't=20 > macro-expand immediate operands of ##. Indeed, poke does # define returns_nonnull /* Nothing. */ # define __returns_nonnull__ /* Nothing. */ and, as you say, it's the latter that is troublesome. Luca, while it would be good to remove this invalid # define __returns_nonnull__ /* Nothing. */ line in the long run, it's OK to leave it in for poke-3.0, since the Gnulib patch that I committed, plus the gnulib submodule update that Jos=E9 commit= ted, will prevent the trouble. > Isn't there still a problem with something like the following, even with= =20 > the latest Gnulib? >=20 > #define __returns_nonnull__ > #include >=20 > That is, it seems to me that the real problem here is a collision with=20 > poke's "#define __returns_nonnull__" before , not with=20 > including twice. True. Although it's rare that people will want to make such macro definitio= ns before '#include '. It's more likely that packages do such macro definitions deep in their own code, when it's seen after the first include = of . > I don't think Gnulib should imply to users that it's OK=20 > to include twice. That's an uncommon practice and is a recipe= =20 > for trouble, as too many programs do fun stuff in their configure.ac=20 > that Gnulib has no control over. Instead, we should clarify Gnulib's=20 > documentation to say that compilation units should include =20 > first, before including anything else, and should not include = =20 > later. I disagree for two reasons: * is an invention of Autoconf, and the Autoconf documentation does not state that should only be included once. It only states that it should be included before the first system header file, otherwise definitions such as '#define _GNU_SOURCE 1' are ineffective. Gnulib, as a user of Autoconf, should not cause additional constraints. In other words, was meant to be idempotent from the beginnin= g, and it's only a Gnulib glitch that caused it to be not idempotent in the face of some invalid "#define __returns_nonnull__". * Additional constraints for the user means more complicated maintenance. If developers have to distinguish .c files which are compiled as a separate compilation unit from .c files which are only included, their code becomes more fragile. And yes, some people do #include .c files, see e.g. gnulib/lib/strtoul.c or https://git.savannah.gnu.org/gitweb/?p=3Dgettext.git;a=3Dblob;f=3Dgette= xt-runtime/libasprintf/lib-asprintf.c;h=3Dc2fe4ed161f2716df3d5a96890154aa55= c0fc656;hb=3Deb83efc3b58d690d444da0b82c3ecf36a54f28ac It's better to continue to give them the freedom of adding '#include ' where they feel a need for. The simpler the documentation is on this topic, the easier Gnulib can be used, and the fewer people curse Gnulib and Autoconf. In the case that you mentioned, that the developer has added AH_VERBATIM invocations in their configure.ac and that it destroys the idempotency of , that's entirely their problem. The Gnulib or Autoconf documentation should not force practices on the user that are entirely in the domain / responsibility of the user. > Obviously we can't make Gnulib immune to arbitrary #defines of reserved=20 > names. This is not to say that we shouldn't accommodate GNU poke, just=20 > that it's not clear that the cure is right here, as a general rule. The change that I committed had two effects: (1) Work around that arbitrary #define. (2) Allow to override these _GL_ATTRIBUTE_* macros for the scope of a compilation unit. We already have seen the need to override _GL_ARG_NONNULL at compilation-unit scope. Similar needs may arise for any _GL_ATTRIBUTE_* macro. So, I'd like to keep this commit, even if the rationale (1) is debatable. Bruno