mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Suppress unused-but-set-variable warning in parsers
This is very ugly: Bison provides a yynerrs variable, which is usually not actually used, but also not annotated with YY_MAYBE_UNUSED. Suppress this warning by adding a (void)yynerrs into the top-level reduction action. The alternative would be to disable the warning for these generated files.
This commit is contained in:
parent
04f5da4b77
commit
107ad28350
4 changed files with 4 additions and 3 deletions
|
@ -308,7 +308,7 @@ static void zval_ini_dtor(zval *zv)
|
||||||
|
|
||||||
statement_list:
|
statement_list:
|
||||||
statement_list statement
|
statement_list statement
|
||||||
| %empty
|
| %empty { (void) ini_nerrs; }
|
||||||
;
|
;
|
||||||
|
|
||||||
statement:
|
statement:
|
||||||
|
|
|
@ -292,7 +292,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||||
%% /* Rules */
|
%% /* Rules */
|
||||||
|
|
||||||
start:
|
start:
|
||||||
top_statement_list { CG(ast) = $1; }
|
top_statement_list { CG(ast) = $1; (void) zendnerrs; }
|
||||||
;
|
;
|
||||||
|
|
||||||
reserved_non_modifiers:
|
reserved_non_modifiers:
|
||||||
|
|
|
@ -80,6 +80,7 @@ start:
|
||||||
{
|
{
|
||||||
ZVAL_COPY_VALUE(&$$, &$1);
|
ZVAL_COPY_VALUE(&$$, &$1);
|
||||||
ZVAL_COPY_VALUE(parser->return_value, &$1);
|
ZVAL_COPY_VALUE(parser->return_value, &$1);
|
||||||
|
(void) php_json_yynerrs;
|
||||||
YYACCEPT;
|
YYACCEPT;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
@ -66,7 +66,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
|
||||||
input
|
input
|
||||||
: command { $$ = $1; }
|
: command { $$ = $1; }
|
||||||
| input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; }
|
| input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; }
|
||||||
| %empty
|
| %empty { (void) phpdbg_nerrs; }
|
||||||
;
|
;
|
||||||
|
|
||||||
command
|
command
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue