From 88c6637fa9f1703ce97b484aaa890d41c9f94685 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 5 Oct 2005 06:05:22 +0000 Subject: [PATCH] * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError): Use assignments rather than casts-to-void to suppress unused-variable warnings. This pacifies 'lint'. * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress unused-variable warnings. --- ChangeLog | 8 ++++++++ data/glr.c | 18 +++++++++--------- data/lalr1.cc | 15 +++++++-------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index e409ce19..5da560bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-10-04 Paul Eggert + + * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError): + Use assignments rather than casts-to-void to suppress + unused-variable warnings. This pacifies 'lint'. + * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress + unused-variable warnings. + 2005-10-03 Juan Manuel Guerrero * Makefile.am: DJGPP specific files added to EXTRA_DIST. diff --git a/data/glr.c b/data/glr.c index 36a98d85..fa6bde67 100644 --- a/data/glr.c +++ b/data/glr.c @@ -889,9 +889,9 @@ b4_syncline([@oline@], [@ofile@]) static void yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) { - /* `Use' the arguments. */ - (void) yy0; - (void) yy1; + /* Suppress unused-variable warnings. */ + yy0 = yy0; + yy1 = yy1; switch (yyn) { @@ -1633,9 +1633,9 @@ static void yyreportAmbiguity (yySemanticOption* yyx0, yySemanticOption* yyx1, yyGLRStack* yystack]b4_pure_formals[) { - /* `Unused' warnings. */ - (void) yyx0; - (void) yyx1; + /* Suppress unused-variable warnings. */ + yyx0 = yyx0; + yyx1 = yyx1; #if YYDEBUG YYFPUTS ("Ambiguity detected.\nOption 1,\n", stderr); @@ -1847,9 +1847,9 @@ static void yyreportSyntaxError (yyGLRStack* yystack, YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[) { - /* `Unused' warnings. */ - (void) yylvalp; - (void) yyllocp; + /* Suppress unused-variable warnings. */ + yylvalp = yylvalp; + yyllocp = yyllocp; if (yystack->yyerrState == 0) { diff --git a/data/lalr1.cc b/data/lalr1.cc index 565228b6..01fbcd0f 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -411,12 +411,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_; + + /* Suppress unused-variable warnings. */ + if (false) + yysymprint_ (yytype + !&cdebug_, yyvaluep, yylocationp); *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") << ' ' << yytname_[yytype] << " (" @@ -435,10 +435,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; + /* Suppress unused-variable warnings. */ + if (false) + yydestruct_ (yymsg, yytype, yyvaluep, yylocationp); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); -- 2.45.2