cbfstool: Fix fmd_scanner build compatibility
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 <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/10162 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Sol Boucher <solb@chromium.org> Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
This commit is contained in:
parent
df699d545f
commit
c877149e9d
|
@ -93,7 +93,8 @@ $(FMAPTESTS_BINARY): $(FMAPTESTS_COMMON)
|
||||||
|
|
||||||
# Yacc source is superset of header
|
# Yacc source is superset of header
|
||||||
$(obj)/fmd_parser.o: CFLAGS += -Wno-redundant-decls
|
$(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
|
$(obj)/fmd_scanner.o: CFLAGS += -Wno-unused-function
|
||||||
# Tolerate lzma sdk warnings
|
# Tolerate lzma sdk warnings
|
||||||
$(obj)/lzma/C/LzmaEnc.o: CFLAGS += -Wno-sign-compare -Wno-cast-qual
|
$(obj)/lzma/C/LzmaEnc.o: CFLAGS += -Wno-sign-compare -Wno-cast-qual
|
||||||
|
|
|
@ -82,8 +82,10 @@ $(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
||||||
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
||||||
|
|
||||||
# Yacc source is superset of header
|
# Yacc source is superset of header
|
||||||
|
$(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls
|
||||||
$(objutil)/cbfstool/fmd_parser.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
|
$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function
|
||||||
# Tolerate lzma sdk warnings
|
# Tolerate lzma sdk warnings
|
||||||
$(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual
|
$(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int parse_integer(char *input, int base);
|
int parse_integer(char *src, int base);
|
||||||
int copy_string(const char *input);
|
int copy_string(const char *src);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option noyywrap
|
%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;
|
char *multiplier = NULL;
|
||||||
unsigned val = strtoul(input, &multiplier, base);
|
unsigned val = strtoul(src, &multiplier, base);
|
||||||
|
|
||||||
if (*multiplier) {
|
if (*multiplier) {
|
||||||
switch(*multiplier) {
|
switch(*multiplier) {
|
||||||
|
@ -71,8 +71,8 @@ int parse_integer(char *input, int base)
|
||||||
return INTEGER;
|
return INTEGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_string(const char *input)
|
int copy_string(const char *src)
|
||||||
{
|
{
|
||||||
yylval.strval = strdup(input);
|
yylval.strval = strdup(src);
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue