From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 1F66338A8149; Thu, 15 Sep 2022 03:11:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F66338A8149 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 4ED69300089; Thu, 15 Sep 2022 03:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1663211474; bh=9dBuyw+2gJu/jilxI/KO67izwHClxRvp9FOmgj+tkfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=HsIq5MuyOsTAV5TYjLoeoFBkUlqLV1zbzvvZw0YrKgFIMCN6AAoR2punh9B7xkwlu mjeLtYA2nb9mfjzBO+CtpGS8wfhctTTQ1l2nnS1/DDEJLS70W7WUwLgMzKumZJZsU5 QV6RRLBBr6Q1Dw9+/CSMfIagNThWTx64yovLOZD8= From: Tsukasa OI To: Tsukasa OI , Pedro Alves , Joel Brobecker , Enze Li Cc: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH 4/4] gdb: Suppress "unused" variable warning on Clang Date: Thu, 15 Sep 2022 03:10:26 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Clang generates a warning if there is a variable which is written but not read thereafter. By the default configuration (with "-Werror"), it causes a build failure (unless "--disable-werror" is specified). Because the cause of this error is in the Bison-generated code ($(binutils)/gdb/cp-name-parser.y -> $(srcdir)/gdb/cp-name-parser.c), this commit suppresses this warning ("-Wunused-but-set-variable") by placing the DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE macro at the end of user prologue on cp-name-parser.y. gdb/ChangeLog: * cp-name-parser.y: Suppress -Wunused-but-set-variable warning on the Bison-generated code. --- gdb/cp-name-parser.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 34c691ddabb..21ba51679d3 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -248,6 +248,10 @@ cpname_state::make_name (const char *name, int len) static int yylex (YYSTYPE *, cpname_state *); static void yyerror (cpname_state *, const char *); + +#include "diagnostics.h" +DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE + %} %type exp exp1 type start start_opt oper colon_name -- 2.34.1