X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/edb8f44f06cf8a43defa1036bdd6011947d84e91..62b08cfcd72cfd74c22080733d0156122ab27a15:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index 565228b6..91360a52 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -30,7 +30,6 @@ m4_if(b4_defines_flag, 0, [], b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], [2002, 2003, 2004, 2005]) dnl FIXME: This is wrong, we want computed header guards. -dnl FIXME: I do not know why the macros are missing now. :( [ #ifndef PARSER_HEADER_H # define PARSER_HEADER_H @@ -88,7 +87,7 @@ do { \ { \ (Current).begin = (Current).end = (Rhs)[0].end; \ } \ -} while (0) +} while (false) #endif namespace yy @@ -319,6 +318,9 @@ b4_syncline([@oline@], [@ofile@])[ # endif #endif +/* Suppress unused-variable warnings by "using" E. */ +#define YYUSE(e) do {;} while (false && (e)) + /* A pseudo ostream that takes yydebug_ into account. */ # define YYCDEBUG \ for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \ @@ -335,19 +337,19 @@ do { \ yysymprint_ ((Type), (Value), (Location)); \ *yycdebug_ << std::endl; \ } \ -} while (0) +} while (false) # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug_) \ yyreduce_print_ (Rule); \ -} while (0) +} while (false) # define YY_STACK_PRINT() \ do { \ if (yydebug_) \ yystack_print_ (); \ -} while (0) +} while (false) #else /* !YYDEBUG */ @@ -411,12 +413,12 @@ void yy::]b4_parser_class_name[::yysymprint_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - (void) yylocationp; /* Backward compatibility, but should be removed eventually. */ std::ostream& cdebug_ = *yycdebug_; - (void) cdebug_; + + YYUSE (!&cdebug_); + YYUSE (yylocationp); + YYUSE (yyvaluep); *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") << ' ' << yytname_[yytype] << " (" @@ -435,10 +437,9 @@ void yy::]b4_parser_class_name[::yydestruct_ (const char* yymsg, int yytype, semantic_type* yyvaluep, location_type* yylocationp) { - /* Pacify ``unused variable'' warnings. */ - (void) yymsg; - (void) yyvaluep; - (void) yylocationp; + YYUSE (yylocationp); + YYUSE (yymsg); + YYUSE (yyvaluep); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);