mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-10 09:33:36 +00:00
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.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
%{
|
%{
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "diagnostics.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -34,6 +35,8 @@
|
|||||||
|
|
||||||
#include "script-c.h"
|
#include "script-c.h"
|
||||||
|
|
||||||
|
DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* We need to use a pure parser because we might be multi-threaded.
|
/* We need to use a pure parser because we might be multi-threaded.
|
||||||
|
|||||||
Reference in New Issue
Block a user