From f2aa9e112fd0753e62630d811db5b78475d668d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mariusz=20Pluci=C5=84ski?= Date: Fri, 25 Jul 2014 18:36:05 +0200 Subject: [PATCH] Fix `label unused` warning --- src/gen.c | 7 ++----- src/scan.l | 2 +- tests/bison_nr_parser.y | 4 ++-- tests/bison_yylloc_parser.y | 4 ++-- tests/bison_yylval_parser.y | 4 ++-- tests/multiple_scanners_nr_main.c | 21 --------------------- 6 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/gen.c b/src/gen.c index fc1c4a6..049cbfe 100644 --- a/src/gen.c +++ b/src/gen.c @@ -528,11 +528,8 @@ void gen_find_action (void) indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);"); indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];"); - if (!variable_trailing_context_rules) - outn ("m4_ifdef( [[M4_YY_USES_REJECT]],\n[["); - outn ("find_rule: /* we branch to this label when backing up */"); - if (!variable_trailing_context_rules) - outn ("]])\n"); + if(reject_really_used) + outn ("find_rule: /* we branch to this label when backing up */"); indent_puts ("for ( ; ; ) /* until we find what rule we matched */"); diff --git a/src/scan.l b/src/scan.l index 9ff9d74..9eb857a 100644 --- a/src/scan.l +++ b/src/scan.l @@ -95,7 +95,7 @@ extern const char *escaped_qstart, *escaped_qend; %} -%option caseless nodefault stack noyy_top_state +%option caseless nodefault noreject stack noyy_top_state %option nostdinit %x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE diff --git a/tests/bison_nr_parser.y b/tests/bison_nr_parser.y index 57e5c6c..3021048 100644 --- a/tests/bison_nr_parser.y +++ b/tests/bison_nr_parser.y @@ -30,8 +30,8 @@ #include #include #include "config.h" -#include "parser.h" -#include "scanner.h" +#include "bison_nr_parser.h" +#include "bison_nr_scanner.h" #define YYERROR_VERBOSE 1 /* #define YYPARSE_PARAM scanner */ diff --git a/tests/bison_yylloc_parser.y b/tests/bison_yylloc_parser.y index 6cff424..8737291 100644 --- a/tests/bison_yylloc_parser.y +++ b/tests/bison_yylloc_parser.y @@ -33,8 +33,8 @@ #include #include #include "config.h" -#include "parser.h" -#include "scanner.h" +#include "bison_yylloc_parser.h" +#include "bison_yylloc_scanner.h" int yyerror(YYLTYPE *location, void* scanner, const char* msg); diff --git a/tests/bison_yylval_parser.y b/tests/bison_yylval_parser.y index ca8c8da..4159d7b 100644 --- a/tests/bison_yylval_parser.y +++ b/tests/bison_yylval_parser.y @@ -32,8 +32,8 @@ #include #include #include "config.h" -#include "parser.h" -#include "scanner.h" +#include "bison_yylval_parser.h" +#include "bison_yylval_scanner.h" #define YYERROR_VERBOSE 1 diff --git a/tests/multiple_scanners_nr_main.c b/tests/multiple_scanners_nr_main.c index bfdd12a..497bd9f 100644 --- a/tests/multiple_scanners_nr_main.c +++ b/tests/multiple_scanners_nr_main.c @@ -21,8 +21,6 @@ * PURPOSE. */ -#include - #include "multiple_scanners_nr_1.h" #include "multiple_scanners_nr_2.h" @@ -32,27 +30,11 @@ main ( int argc, char** argv ) (void)argc; (void)argv; -<<<<<<< HEAD:tests/multiple_scanners_nr_main.c int S1_ok=1, S2_ok=1; YY_BUFFER_STATE buff1, buff2; S1_out = S2_out = stdout; buff1 = S1__scan_string("foo on bar off"); buff2 = S2__scan_string("on blah blah off foo on bar off"); -======= - yyscan_t scanner; - FILE *fp; - char * extra = "EXTRA"; - - testlex_init(&scanner); - testset_in(stdin,scanner); - testset_out(stdout,scanner); - testset_extra(extra,scanner); - - fp = testget_in(scanner); - assert(fp == stdin); - fp = testget_out(scanner); - assert(fp == stdout); ->>>>>>> Remove a few `unused variable` warnings:tests/test-linedir-r/main.c /* scan simultaneously. */ while(S1_ok || S2_ok) @@ -67,6 +49,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ -- 2.40.0