From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zcFZKJkCpmgLCggAWB0awg (envelope-from ) for ; Wed, 20 Aug 2025 13:15:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1755710105; bh=b1ROLMleqwMGBA8n3B51f8v432ldVAf+r4u1dsA8pl0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BSm6bDIF98vTp7oz3TdLthFbC/KtqDltuj0mYhEAZVtUtjVwyoItIyuzGGq8hCXAm /WMlY+Slj5pi+GnLG92DjRyTSUtv76YAvdrCIXES8PMS1Ds8Zv+mbrIV+FHzCMT9gL eseRFlflvTL/61GFh9pk+HdOupPTB+wtnxRsceuQ= Received: by simark.ca (Postfix, from userid 112) id 9369A1E0B3; Wed, 20 Aug 2025 13:15:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=pLN46Wgo; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EBA8A1E047 for ; Wed, 20 Aug 2025 13:15:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81D79385E45A for ; Wed, 20 Aug 2025 17:15:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81D79385E45A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=pLN46Wgo Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 03EFE385DDDC for ; Wed, 20 Aug 2025 17:14:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03EFE385DDDC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03EFE385DDDC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755710075; cv=none; b=gYnHNEwAIMUEt3PR60GKrnibW5PA4wYpWPXP2U7wAvobcrNfJhF0sQ2216kqDLePFBdvZflJ5Mf90+fjh6A5auIJX5VLhQIdXGgqmZKDxT2ZDKbFyNb9u2JyEjLFGQDIMhPCc09TKkmpzODm8PqlS6zuemFYYR5A4LXRypWMM28= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755710075; c=relaxed/simple; bh=b1ROLMleqwMGBA8n3B51f8v432ldVAf+r4u1dsA8pl0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=meeVdOva3BkvcbeqCwAw76allyHsz2dfIkr+90ZQOTCRHYT9QrfN3TOuuGgVvRlrFEiNstl9h2tjMI0jRZao3M2EJmY9aNvCMC86yt/Ogu4iKTO1BvF01dvHayvjMnbC72zOYe0ozbbLQmgXiayrDzC+2fE7Fb3yXCl/BUvkwNE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03EFE385DDDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1755710074; bh=b1ROLMleqwMGBA8n3B51f8v432ldVAf+r4u1dsA8pl0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pLN46WgoTiHcAFJPYIOg11OeKuxKYrJoQsy5pc3pZXx1j2jvXguOjwDPDOEiRchxY DHDiQBf6dfuB2ueOhDRmAeYLKYcamwGSRUL6QuuAkHzDtfgQFRaIyxjdiHxS+bql/g p9qcfEutM4NQgAKAW9j6vsIPtkS5UTn/6IS00TQM= Received: by simark.ca (Postfix) id 9D22C1E047; Wed, 20 Aug 2025 13:14:34 -0400 (EDT) Message-ID: Date: Wed, 20 Aug 2025 13:14:33 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] Use gnulib c-ctype module, not To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20250806-gnulib-c-ctype-v1-0-10f33e9f22a4@adacore.com> <87h5yiq32b.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87h5yiq32b.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/7/25 4:39 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> My understanding is that poisoning using macros doesn't work, because it > Simon> interferes with identifiers of the same name in other headers. But > Simon> would it be possible to do it using "#pragma GCC poison"? Like: > > I didn't try it but that's because I believe it won't work. > > The pragma is better than the preprocessor approach, the manual says: > > If a poisoned identifier appears as part of the expansion of a > macro which was defined before the identifier was poisoned, it will > _not_ cause an error. This lets you poison an identifier without > worrying about system headers defining macros that use it. > > However in our case the poisoning would likely occur before the > inclusion of the offending header. The workaround would be to include > the locale (and maybe iostream?) headers everywhere, but I think we > definitely should not do that. > > FTR the failure I saw (with cpp-style poisoning, a la safe-ctype.h) came > from source-cache.c which includes some locale stuff via . Indeed, it doesn't work: CXX agent.o In file included from ../gnulib/import/ctype.h:35, from /usr/include/c++/15.2.1/cctype:47, from /usr/include/c++/15.2.1/bits/localefwd.h:44, from /usr/include/c++/15.2.1/string:47, from /home/smarchi/src/binutils-gdb/gdbsupport/ptid.h:36, from /home/smarchi/src/binutils-gdb/gdbsupport/common-defs.h:214, from : /usr/include/ctype.h:108:12: error: attempt to use poisoned ‘isalnum’ 108 | __exctype (isalnum); | ^ /home/smarchi/src/binutils-gdb/gdbsupport/common-defs.h:208:20: note: poisoned here 208 | #pragma GCC poison isalnum | ^~~~~~~ > The main issue here is that the pragma works on an identifier basis but > really we'd like to be more selective and only exclude some particular > functions. As far as I'm concerned, this patch series LGTM, I'm not aware of better alternatives. Approved-By: Simon Marchi Simon