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

-Wuseless-action #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

-Wuseless-action #8

wants to merge 5 commits into from

Conversation

akimd
Copy link
Owner

@akimd akimd commented Apr 4, 2019

Introduce -Wuseless-action to warn about rules with a useless { $$ = $1; } action.

* src/complain.h, src/complain.c: Add support for -Wuseless-action.
@akimd akimd changed the title Wstyle -Wuseless-action Jul 7, 2020
akimd added 4 commits July 7, 2020 07:23
* tests/glr-regression.at, tests/java.at, tests/torture.at,
* examples/c/lexcalc/parse.y, examples/c/reccalc/parse.y: here.
* src/parse-gram.y: Likewise.
Style changes.
In order for the useless chain productions to work properly, there
should not be actions that make explicit the default behavior.

* src/scan-code.l (strspacecmp, useless_default_action): New.
(translate_action): Report useless actions.
* src/reader.c (grammar_rule_check_and_complete): Don't trigger this
warning when generating explicit actions for C++.
* tests/actions.at (Useless default actions): New.
* doc/bison.texi, src/getargs.c, NEWS: here.
@GitMensch
Copy link

@akimd: Was there a reason to not include this in one of the last releases?

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