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

yynerrs unused-but-set-variable warning with Clang 15 #89

Closed
nikic opened this issue Jul 28, 2022 · 2 comments
Closed

yynerrs unused-but-set-variable warning with Clang 15 #89

nikic opened this issue Jul 28, 2022 · 2 comments

Comments

@nikic
Copy link

nikic commented Jul 28, 2022

When building bison-generated parsers using Clang 15, a -Wunused-but-set-variable warning is thrown for the usually unused yynerrs variable:

/home/nikic/php/php-src-fast/Zend/zend_language_parser.c:4487:9: error: variable 'zendnerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs;
        ^
/home/nikic/php/php-src-fast/Zend/zend_language_parser.c:93:25: note: expanded from macro 'yynerrs'
#define yynerrs         zendnerrs

Probably the declaration needs to be annotated with YY_ATTRIBUTE_UNUSED.

@akimd akimd closed this as completed in a166d54 Aug 2, 2022
@akimd
Copy link
Owner

akimd commented Aug 2, 2022

Thanks for the report!

@cooljeanius
Copy link

Thanks for the report!

@akimd any plans to include closing commit a166d54 in a release anytime soon? See further discussion in #103

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

No branches or pull requests

3 participants