From aa689b96e6a1f0c5c027c1e867d4afe5dc49d68f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 27 Mar 2025 14:55:51 +0000 Subject: [PATCH] nix-expr/parser: Suppress warning We rely on `yyerror()` instead. > The variable yynerrs contains the number of syntax errors reported so > far. > Normally this variable is global; but if you request a pure parser > (see A Pure (Reentrant) Parser) then it is a local variable which only > the actions can access. https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html --- src/libexpr/parser.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index bde721401..dc58e8d53 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -179,7 +179,12 @@ static Expr * makeCall(PosIdx pos, Expr * fn, Expr * arg) { %% -start: expr { state->result = $1; }; +start: expr { + state->result = $1; + + // This parser does not use yynerrs; suppress the warning. + (void) yynerrs; +}; expr: expr_function;