Skip to content

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.
@akimd akimd force-pushed the master branch 6 times, most recently from 3a24da1 to f9b3606 Compare September 26, 2020 16:33
@akimd akimd force-pushed the master branch 2 times, most recently from 734eb80 to 66706a7 Compare December 19, 2020 06:30
@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.

3 participants