From 24bb5f8fb7f14df4050cbefd27ae60fa9cef259d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 18 Feb 2012 18:48:33 +0100 Subject: [PATCH] maint: fix some syntax-check issues. * cfg.mk (local-checks-to-skip): Remove sc_prohibit_quotearg_without_use, sc_prohibit_strcmp, sc_unmarked_diagnostics, sc_useless_cpp_parens. (sc_unmarked_diagnostics): Skip DJGPP. * data/yacc.c, src/LR0.c, src/closure.c, * src/flex-scanner.h, src/gram.c, src/lalr.c, * src/print-xml.c, src/print.c, src/print_graph.c, * src/reader.c, src/reduce.c, src/tables.c: Don't use parens with cpp's defined. Remove useless includes. --- cfg.mk | 6 ++---- data/yacc.c | 2 +- src/LR0.c | 1 - src/closure.c | 1 - src/flex-scanner.h | 6 +++--- src/gram.c | 2 -- src/lalr.c | 1 - src/print-xml.c | 1 - src/print.c | 1 - src/print_graph.c | 2 -- src/reader.c | 1 - src/reduce.c | 1 - src/tables.c | 1 - 13 files changed, 6 insertions(+), 20 deletions(-) diff --git a/cfg.mk b/cfg.mk index 80bd73b0..a7b16c57 100644 --- a/cfg.mk +++ b/cfg.mk @@ -48,10 +48,7 @@ local-checks-to-skip = \ sc_prohibit_doubled_word \ sc_prohibit_empty_lines_at_EOF \ sc_prohibit_magic_number_exit \ - sc_prohibit_quotearg_without_use \ - sc_prohibit_strcmp \ - sc_unmarked_diagnostics \ - sc_useless_cpp_parens + sc_prohibit_strcmp # The local directory containing the checked-out copy of gnulib used in # this release. Used solely to get a date for the "announcement" target. @@ -70,3 +67,4 @@ update-copyright-env = \ exclude_file_name_regexp--sc_space_tab = ^tests/(input|c\+\+)\.at$$ exclude_file_name_regexp--sc_require_config_h_first = \ ^(lib/yyerror|data/(glr|yacc))\.c$$ +exclude_file_name_regexp--sc_unmarked_diagnostics = ^djgpp/ diff --git a/data/yacc.c b/data/yacc.c index 2beef804..3d535009 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -2018,7 +2018,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if ]b4_lac_if([[1]], [[!defined(yyoverflow) || YYERROR_VERBOSE]])[ +#if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[ /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ diff --git a/src/LR0.c b/src/LR0.c index 6b4f145e..37bfe813 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -26,7 +26,6 @@ #include "system.h" #include -#include #include "LR0.h" #include "closure.h" diff --git a/src/closure.c b/src/closure.c index 9e5531b3..d9bc5ffa 100644 --- a/src/closure.c +++ b/src/closure.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "closure.h" #include "derives.h" diff --git a/src/flex-scanner.h b/src/flex-scanner.h index 7c055b97..23a266ac 100644 --- a/src/flex-scanner.h +++ b/src/flex-scanner.h @@ -51,11 +51,11 @@ int FLEX_PREFIX (lex_destroy) (void); versions according to the Flex manual) leak memory if yylex_destroy is not invoked. However, yylex_destroy is not defined before Flex 2.5.9, so give an implementation here that at least appears to work with Flex 2.5.4. */ -#if !defined(YY_FLEX_MAJOR_VERSION) || YY_FLEX_MAJOR_VERSION < 2 \ +#if !defined YY_FLEX_MAJOR_VERSION || YY_FLEX_MAJOR_VERSION < 2 \ || (YY_FLEX_MAJOR_VERSION == 2 \ - && (!defined(YY_FLEX_MINOR_VERSION) || YY_FLEX_MINOR_VERSION < 5 \ + && (!defined YY_FLEX_MINOR_VERSION || YY_FLEX_MINOR_VERSION < 5 \ || (YY_FLEX_MINOR_VERSION == 5 \ - && (!defined(YY_FLEX_SUBMINOR_VERSION) \ + && (!defined YY_FLEX_SUBMINOR_VERSION \ || YY_FLEX_SUBMINOR_VERSION < 9)))) # define yylex_destroy() yy_delete_buffer (YY_CURRENT_BUFFER) #endif diff --git a/src/gram.c b/src/gram.c index cd9e67cb..d1b38043 100644 --- a/src/gram.c +++ b/src/gram.c @@ -21,8 +21,6 @@ #include #include "system.h" -#include - #include "complain.h" #include "getargs.h" #include "gram.h" diff --git a/src/lalr.c b/src/lalr.c index 860c66a0..98661544 100644 --- a/src/lalr.c +++ b/src/lalr.c @@ -27,7 +27,6 @@ #include #include -#include #include "LR0.h" #include "complain.h" diff --git a/src/print-xml.c b/src/print-xml.c index 400ce69f..e37a7414 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -23,7 +23,6 @@ #include #include -#include #include "LR0.h" #include "closure.h" diff --git a/src/print.c b/src/print.c index 9b855113..cb227aa5 100644 --- a/src/print.c +++ b/src/print.c @@ -22,7 +22,6 @@ #include "system.h" #include -#include #include "LR0.h" #include "closure.h" diff --git a/src/print_graph.c b/src/print_graph.c index 179b5b10..8571e147 100644 --- a/src/print_graph.c +++ b/src/print_graph.c @@ -20,8 +20,6 @@ #include #include "system.h" -#include - #include "LR0.h" #include "closure.h" #include "complain.h" diff --git a/src/reader.c b/src/reader.c index 5b909ff3..7dd0aaa4 100644 --- a/src/reader.c +++ b/src/reader.c @@ -22,7 +22,6 @@ #include "system.h" #include -#include #include "complain.h" #include "conflicts.h" diff --git a/src/reduce.c b/src/reduce.c index f7bc380a..5338393c 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -29,7 +29,6 @@ #include "system.h" #include -#include #include "complain.h" #include "files.h" diff --git a/src/tables.c b/src/tables.c index 2a243cfb..eb827b76 100644 --- a/src/tables.c +++ b/src/tables.c @@ -22,7 +22,6 @@ #include "system.h" #include -#include #include "complain.h" #include "conflicts.h" -- 2.45.2