bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] c++: better silencing of warnings


From: Akim Demaille
Subject: Re: [PATCH 3/4] c++: better silencing of warnings
Date: Mon, 21 Jan 2013 12:06:39 +0100

Le 21 janv. 2013 à 12:46, Theophile Ranquet <address@hidden> a écrit :

> * tests/c++.at (C++ GLR parser identifier shadowing): Don't name unused
> arguments, this is legal in C++.

You don't need to say it's valid C++ :)
The title is wrong btw, it's about tests, not about c++ generation.
And please clarify the kind of warnings fixed.

> ---
> tests/c++.at | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/c++.at b/tests/c++.at
> index ad08b8a..0bebe8a 100644
> --- a/tests/c++.at
> +++ b/tests/c++.at
> @@ -781,14 +781,15 @@ exp: ZERO
> 
> int yylex (yy::parser::semantic_type *yylval)
> {
> -  (void) *yylval;
> +  // Note: this argument is unused, but named on purpose.  There used to be a
> +  // bug with a macro that erroneously expanded this identifier to
> +  // yystackp->yyval.
> +  YYUSE (yylval);
>   return yy::parser::token::ZERO;
> }
> 
> -void yy::parser::error (std::string const& msg)
> -{
> -  (void) msg;
> -}
> +void yy::parser::error (std::string const&)
> +{}
> 
> int main()
> {}
> -- 
> 1.8.1.1
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]