Skip to content

Commit a24df34

Browse files
committed
Silence Clang warning in generated psqlplus parser
Clang warns that the generated SQL*Plus parser keeps a local yynerrs counter that is assigned but never read. The warning comes from Bison output, not from handwritten parser actions. Warning excerpt: ``` psqlplusparse.c:983:9: warning: variable psqlplus_yynerrs set but not used [-Wunused-but-set-variable] ``` Follow the existing PostgreSQL grammar pattern by referencing yynerrs with (void) yynerrs in the top-level rule action.
1 parent 0da228b commit a24df34

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/bin/psql/psqlplusparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ psqlplus_toplevel_stmt:
7373
variable_stmt opt_semi
7474
{
7575
psql_yyget_extra(yyscanner)->psqlpluscmd = $1;
76+
(void) yynerrs; /* suppress compiler warning */
7677
}
7778
| print_stmt opt_semi
7879
{

0 commit comments

Comments
 (0)