aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2022-09-26 10:35:40 +0000
committerAlan Modra <amodra@gmail.com>2022-09-27 15:04:02 +0930
commitf7aa1a5acc5faa03ed6c640a426ef70a5f328940 (patch)
tree45e205c439ab5e089b265d7acb01acd96ce20bf6 /gold
parent8818c80cbd4116ef5af171ec47c61167179e225c (diff)
downloadgdb-f7aa1a5acc5faa03ed6c640a426ef70a5f328940.zip
gdb-f7aa1a5acc5faa03ed6c640a426ef70a5f328940.tar.gz
gdb-f7aa1a5acc5faa03ed6c640a426ef70a5f328940.tar.bz2
gold: Suppress "unused" variable warning on Clang
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. * yyscript.y: Suppress -Wunused-but-set-variable warning on the Bison-generated code.
Diffstat (limited to 'gold')
-rw-r--r--gold/yyscript.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/gold/yyscript.y b/gold/yyscript.y
index 909786f..fe8f681 100644
--- a/gold/yyscript.y
+++ b/gold/yyscript.y
@@ -26,6 +26,7 @@
%{
#include "config.h"
+#include "diagnostics.h"
#include <stddef.h>
#include <stdint.h>
@@ -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.