-
Notifications
You must be signed in to change notification settings - Fork 601
pp_aasign: silence "var set but not used" warning #23689
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
Conversation
PERL_RC_STACK builds were giving this warning:
pp_hot.c:3147:21: warning: variable 'i' set but not used
[-Wunused-but-set-variable]
which was true: under that build, the i variable was being set but
not used in a couple of places (it's value is only used on
non-PERL_RC_STACK builds).
So avoid that var under PERL_RC_STACK builds.
I will test this out later today. |
|
We use C99 now, so I think it would make sense to move the declarations of |
Possibly, but I'd prefer to keep this commit as minimal as possible, to just address the issue at hand. |
jkeenan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configured and built with clang and -DPERL_RC_STACK on both Linux and FreeBSD; build-time warning gone. Also built with g++ and -DPERL_RC_STACK on Linux; this particular build-time warning was not emitted. Ready to merge.
| SV **svp; | ||
| #ifndef PERL_RC_STACK | ||
| SSize_t i; | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When struggling with the build-time warning (as mentioned in #23661 (comment)), I got this far ...
| #else | ||
| for (i = 0, svp = relem; svp <= lastrelem; i++, svp++) | ||
| #endif | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but didn't realize I should have put this for loop statement inside an #ifdef ... #else ... #endif structure; below as well. Thanks.
PERL_RC_STACK builds were giving this warning:
which was true: under that build, the i variable was being set but not used in a couple of places (it's value is only used on non-PERL_RC_STACK builds).
So avoid that var under PERL_RC_STACK builds.