YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.5k stars 895 forks source link

verilog_parser: silence yynerrs warning #4667

Closed widlarizer closed 1 month ago

widlarizer commented 1 month ago

yynerrs is an automatically emitted variable we have no use for. Ignoring warnings isn't in good taste and leads to overlooking more meaningful ones.

frontends/verilog/verilog_parser.tab.cc:3743:9: warning: variable 'frontend_verilog_yynerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs = 0;
        ^
frontends/verilog/verilog_parser.tab.cc:74:25: note: expanded from macro 'yynerrs'
#define yynerrs         frontend_verilog_yynerrs
                        ^

In this PR I cast the variable to void at a reasonably top level rule in the parser. You can check the effect by observing there's no yynerrs warning when building this PR, but there is when building its parent commit