From 124df5f6caabf6be40434c75b4c945f908d01904 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 23 Oct 2011 23:32:06 +0200 Subject: [PATCH] Fine grainely disable warnings on lexer. Remove Wno-error on it. * grub-core/Makefile.core.def (normal): Remove -Wno-error. * grub-core/script/lexer.c: Declare yytext_ptr to avoid having yylex_strncpy. * grub-core/script/yylex.l: Add fine-grained #pragma. --- ChangeLog | 9 +++++++++ grub-core/Makefile.core.def | 2 +- grub-core/script/lexer.c | 1 + grub-core/script/yylex.l | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 579f510b0..637fa622b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-10-23 Vladimir Serbinenko + + Fine grainely disable warnings on lexer. Remove Wno-error on it. + + * grub-core/Makefile.core.def (normal): Remove -Wno-error. + * grub-core/script/lexer.c: Declare yytext_ptr to avoid having + yylex_strncpy. + * grub-core/script/yylex.l: Add fine-grained #pragma. + 2011-10-23 Vladimir Serbinenko * grub-core/lib/posix_wrap/string.h (memcpy) [GRUB_UTIL]: diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 7cb83924c..6d3c31ea6 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1395,7 +1395,7 @@ module = { extra_dist = script/yylex.l; extra_dist = script/parser.y; - cflags = '$(CFLAGS_POSIX) -Wno-error'; + cflags = '$(CFLAGS_POSIX)'; cppflags = '$(CPPFLAGS_POSIX)'; }; diff --git a/grub-core/script/lexer.c b/grub-core/script/lexer.c index 98279079f..53697c734 100644 --- a/grub-core/script/lexer.c +++ b/grub-core/script/lexer.c @@ -24,6 +24,7 @@ #include #include +#define yytext_ptr char * #include "grub_script.tab.h" #include "grub_script.yy.h" diff --git a/grub-core/script/yylex.l b/grub-core/script/yylex.l index 7195a880d..012d88dbc 100644 --- a/grub-core/script/yylex.l +++ b/grub-core/script/yylex.l @@ -24,6 +24,9 @@ #include #include "grub_script.tab.h" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + #define yyfree grub_lexer_yyfree #define yyalloc grub_lexer_yyalloc #define yyrealloc grub_lexer_yyrealloc