From c877149e9d46b0de4bc709faf3cfb4f0a23c9cc5 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Sat, 9 May 2015 08:06:02 +0300 Subject: cbfstool: Fix fmd_scanner build compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes these errors: error: declaration of ‘input’ shadows a global declaration [-Werror=shadow] error: redundant redeclaration of ‘isatty’ [-Werror=redundant-decls] Change-Id: I4563d36e5389db4fdc5be3ca4e0e88af2642f7f8 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/10162 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks Reviewed-by: Sol Boucher Reviewed-by: Timothy Pearson --- util/cbfstool/Makefile | 3 ++- util/cbfstool/Makefile.inc | 4 +++- util/cbfstool/fmd_scanner.l | 12 ++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile index 4238445aa8..6e8235b49f 100644 --- a/util/cbfstool/Makefile +++ b/util/cbfstool/Makefile @@ -93,7 +93,8 @@ $(FMAPTESTS_BINARY): $(FMAPTESTS_COMMON) # Yacc source is superset of header $(obj)/fmd_parser.o: CFLAGS += -Wno-redundant-decls -# Lex generates unneeded functions +# Lex generates unneeded functions and declarations +$(obj)/fmd_scanner.o: CFLAGS += -Wno-redundant-decls $(obj)/fmd_scanner.o: CFLAGS += -Wno-unused-function # Tolerate lzma sdk warnings $(obj)/lzma/C/LzmaEnc.o: CFLAGS += -Wno-sign-compare -Wno-cast-qual diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index 1aa9d76ae4..52c3e42c00 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -82,8 +82,10 @@ $(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj)) $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj)) # Yacc source is superset of header +$(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls $(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls -# Lex generates unneeded functions +# Lex generates unneeded functions and declarations +$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-redundant-decls $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function # Tolerate lzma sdk warnings $(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual diff --git a/util/cbfstool/fmd_scanner.l b/util/cbfstool/fmd_scanner.l index d2cc43d04c..0a582105f3 100644 --- a/util/cbfstool/fmd_scanner.l +++ b/util/cbfstool/fmd_scanner.l @@ -23,8 +23,8 @@ #include #include -int parse_integer(char *input, int base); -int copy_string(const char *input); +int parse_integer(char *src, int base); +int copy_string(const char *src); %} %option noyywrap @@ -44,10 +44,10 @@ MULTIPLIER [KMG] %% -int parse_integer(char *input, int base) +int parse_integer(char *src, int base) { char *multiplier = NULL; - unsigned val = strtoul(input, &multiplier, base); + unsigned val = strtoul(src, &multiplier, base); if (*multiplier) { switch(*multiplier) { @@ -71,8 +71,8 @@ int parse_integer(char *input, int base) return INTEGER; } -int copy_string(const char *input) +int copy_string(const char *src) { - yylval.strval = strdup(input); + yylval.strval = strdup(src); return STRING; } -- cgit v1.2.3