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 EC9B23858286 for ; Mon, 26 Sep 2022 10:35:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EC9B23858286 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 6E787300089; Mon, 26 Sep 2022 10:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1664188554; bh=IDnnb1/lNHoe6Tdbb+fpr+RRA5FEVIQlS5OUtTVHqbY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=KQcwUEZprN9rEQPpREcTwWRD/bmT4juwEiaYAen1aoMWCJ1spXrVotnK3+RyjW46r RFu1ZiV0pXLzk3bzbO42NgS5NIViOLMOwBJ4rbUEDnF6rnJS7wL2htwSuDFq6wl6ac z36CyZA4BqZybCEoq0m2/cQBwGuUOolHa257f0vw= From: Tsukasa OI To: Tsukasa OI , Ian Lance Taylor , Cary Coutant Cc: binutils@sourceware.org Subject: [PATCH 1/1] gold: Suppress "unused" variable warning on Clang Date: Mon, 26 Sep 2022 10:35:40 +0000 Message-Id: <3eadb55f979c9a93bba01818b300f90ea048fc55.1664188522.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP 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 that is set but not used otherwise ("-Wunused-but-set-variable"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). Because the cause of this error is in the Bison-generated code ($(srcdir)/gold/yyscript.y -> $(builddir)/gold/yyscript.c), this commit suppresses this warning ("-Wunused-but-set-variable") by placing DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE macro at the end of user prologue on yyscript.y. gold/ChangeLog: * yyscript.y: Suppress -Wunused-but-set-variable warning on the Bison-generated code. --- gold/yyscript.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gold/yyscript.y b/gold/yyscript.y index 909786f0ddd..fe8f6812712 100644 --- a/gold/yyscript.y +++ b/gold/yyscript.y @@ -26,6 +26,7 @@ %{ #include "config.h" +#include "diagnostics.h" #include #include @@ -34,6 +35,8 @@ #include "script-c.h" +DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE + %} /* We need to use a pure parser because we might be multi-threaded. -- 2.34.1