Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verilog_parser: silence yynerrs warning #4667

Merged
merged 1 commit into from
Oct 15, 2024
Merged

verilog_parser: silence yynerrs warning #4667

merged 1 commit into from
Oct 15, 2024

Conversation

widlarizer
Copy link
Collaborator

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

@widlarizer widlarizer requested a review from zachjs as a code owner October 15, 2024 10:21
@zachjs zachjs merged commit 81bbde6 into main Oct 15, 2024
40 checks passed
@mmicko mmicko deleted the emil/no-warn-yynerrs branch October 21, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants