From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WL+1ALYzqGH2MwAAWB0awg (envelope-from ) for ; Wed, 01 Dec 2021 21:47:18 -0500 Received: by simark.ca (Postfix, from userid 112) id F2D971F0CE; Wed, 1 Dec 2021 21:47:17 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 868A21EDF0 for ; Wed, 1 Dec 2021 21:47:17 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 290D6385803A for ; Thu, 2 Dec 2021 02:47:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 290D6385803A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638413237; bh=rMDFDFFDJ8cV9F0Yf9Sr++ygTLtXgVP33E2t/cAgIho=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dEsyQgpbV909bFY3oblSoyqIyFYS0hKObzWYtdPsvJd+es7Pscfv+L16QpdjG5nVI A0VsaHqZtIbB8qfZy3M02z/tIJyy3URl/jgq8Xq1MJhNs1JJSyVJs156+P+8ZStsNW r+B1o8o5G/h6WHyCqHqBFsdqh+eMg0hSf06WG7kk= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 7AB47385801C; Thu, 2 Dec 2021 02:45:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AB47385801C 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 1B22jjRE010222 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 1 Dec 2021 21:45:49 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1B22jjRE010222 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3FC511EDF0; Wed, 1 Dec 2021 21:45:44 -0500 (EST) Message-ID: <30890d40-e70f-a1c9-5015-9064a4b6067c@polymtl.ca> Date: Wed, 1 Dec 2021 21:45:44 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 2/2] include, gdb: fix -Wswitch build errors with gcc 4.8 Content-Language: en-US To: Tom de Vries , Simon Marchi , gdb-patches@sourceware.org, binutils@sourceware.org References: <20211123211437.3783065-1-simon.marchi@efficios.com> <20211123211437.3783065-2-simon.marchi@efficios.com> <2278406c-c8cd-abf5-a0e5-69e367e3c385@suse.de> In-Reply-To: <2278406c-c8cd-abf5-a0e5-69e367e3c385@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 2 Dec 2021 02:45:45 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > It looks a bit funny to do the push unconditionally, and the pop > conditionally. Hmm that was a mistake. > Is this not better fixed at the def site, once, rather than at two use > sites? How about this instead: > ... > diff --git a/include/diagnostics.h b/include/diagnostics.h > index 5ab43a85e9c..43f0458bd8c 100644 > --- a/include/diagnostics.h > +++ b/include/diagnostics.h > @@ -79,8 +79,10 @@ > # define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \ > DIAGNOSTIC_IGNORE ("-Wformat-nonliteral") > > +#if __GNUC__ >= 5 > # define DIAGNOSTIC_ERROR_SWITCH \ > DIAGNOSTIC_ERROR ("-Wswitch") > +#endif Yeah, that makes sense, all call sites will end up with this. Done in v2. Simon