Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
anntzer merged 1 commit intomatplotlib:mainfromBiswa96:fix-error-mingw
May 17, 2022
Merged

Fix variable initialization due to jump bypassing it#23051

anntzer merged 1 commit intomatplotlib:mainfromBiswa96:fix-error-mingw
May 17, 2022

Conversation

Biswa96
Copy link
Contributor

PR Summary

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...

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

This fixes the following error in mingw gcc toolchain. Also clangalso 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 bypassesdeclarations with initialization. A program that jumps from a point wherea variable with automatic storage duration is not in scope to a pointwhere it is in scope is ill-formed unless the variable has scalar type...
Copy link

@github-actionsgithub-actionsbot left a 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 uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

Biswa96 reacted with heart emoji
@tacaswelltacaswell added this to thev3.5.3 milestoneMay 15, 2022
@tacaswell
Copy link
Member

tacaswell commentedMay 15, 2022
edited
Loading

Thank you!

This fix is also included in#22999 [edit correct PR number]

@Biswa96
Copy link
ContributorAuthor

Should I close this?

@DWesl
Copy link
Contributor

Given that#22999 is failing with error message "command did not succeed", it might be a while before that goes in.

Copy link
Member

@QuLogicQuLogic left a 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.

@anntzer
Copy link
Contributor

Thanks for the fix, hoping to see you around again.

@anntzeranntzer merged commitf25c2d0 intomatplotlib:mainMay 17, 2022
@Biswa96Biswa96 deleted the fix-error-mingw branchMay 17, 2022 12:17
@tacaswell
Copy link
Member

@meeseeksbot please backport to v3.5.x

@QuLogic
Copy link
Member

meeseeksdev backport to v3.5.x

@tacaswell
Copy link
Member

thank you@QuLogic .

QuLogic added a commit that referenced this pull requestMay 18, 2022
…051-on-v3.5.xBackport PR#23051 on branch v3.5.x (Fix variable initialization due to jump bypassing it)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@QuLogicQuLogicQuLogic approved these changes

@anntzeranntzeranntzer approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.5.3
Development

Successfully merging this pull request may close these issues.

5 participants
@Biswa96@tacaswell@DWesl@anntzer@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp