From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120496 invoked by alias); 16 Jan 2019 20:59:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120479 invoked by uid 89); 16 Jan 2019 20:59:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=oriented, Hx-languages-length:1075, unary, his X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Jan 2019 20:59:07 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id x0GKx11t002388 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Jan 2019 15:59:05 -0500 Received: by simark.ca (Postfix, from userid 112) id ED0F41E7BD; Wed, 16 Jan 2019 15:59:00 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 8B9631E4C2; Wed, 16 Jan 2019 15:58:58 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 16 Jan 2019 20:59:00 -0000 From: Simon Marchi To: Andreas Schwab Cc: =?UTF-8?Q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB_=D0=9A=D1=80=D1=8E=D0=BA?= =?UTF-8?Q?=D0=BE=D0=B2?= , gdb-patches@sourceware.org Subject: Re: [PATCH] Do not expand macros to 'defined' In-Reply-To: <87h8e89vmk.fsf@igel.home> References: <4943ce6216667607c40b630ecba6a4d1@polymtl.ca> <87h8e89vmk.fsf@igel.home> Message-ID: <275ec5da5d0654e7b87227e5373a6148@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00385.txt.bz2 On 2019-01-16 15:48, Andreas Schwab wrote: > On Jan 16 2019, Simon Marchi wrote: > >> The patch LGTM, I agree these macros are not really needed. But I am >> confused, does this actually fix your c++ build? You mentioned you >> were >> using g++ (and therefore cpp), which supposedly can handle this fine: >> >> https://gcc.gnu.org/onlinedocs/cpp/Defined.html >> >> If so, what did the error look like? > > This has nothing to do with C vs. C++, both have the same wording: > > If the token defined is generated as a result of this replacement > process or use of the defined unary operator does not match one of > the two specified forms prior to macro replacement, the behavior is > undefined. > > Andreas. That's why I was confused, the purpose of Pavel's patch that was replaced by this one is C++-oriented: https://sourceware.org/ml/gdb-patches/2019-01/msg00241.html So in the end it looks like the issue is indeed not about C++, but about his usage of -Wextra (-Wexpansion-to-defined). Simon