-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix variable initialization due to jump bypassing it #23051
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
This fixes the following error in mingw gcc toolchain. Also clang also have same error. src/_tkagg.cpp:274:26: note: crosses initialization of 'bool tk_ok' 274 | bool tcl_ok = false, tk_ok = false; | ^~~~~ src/_tkagg.cpp:274:10: note: crosses initialization of 'bool tcl_ok' 274 | bool tcl_ok = false, tk_ok = false; | ^~~~~~ According to C++ standard (6.7.3): It is possible to transfer into a block, but not in a way that bypasses declarations with initialization. A program that jumps from a point where a variable with automatic storage duration is not in scope to a point where it is in scope is ill-formed unless the variable has scalar type...
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Thank you! This fix is also included in #22999 [edit correct PR number] |
Should I close this? |
Given that #22999 is failing with error message "command did not succeed", it might be a while before that goes in. |
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.
I'm not sure there's actually a problem here, but if it fixes a warning, then LGTM.
Thanks for the fix, hoping to see you around again. |
@meeseeksbot please backport to v3.5.x |
meeseeksdev backport to v3.5.x |
thank you @QuLogic . |
…051-on-v3.5.x Backport PR #23051 on branch v3.5.x (Fix variable initialization due to jump bypassing it)
PR Summary
This fixes the following error in mingw gcc toolchain. Also clang
also have same error.
According to C++ standard (6.7.3):
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).