Skip to content

style: avoid using unintialized variables #2806

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

Merged
merged 2 commits into from
Jan 19, 2021

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Jan 18, 2021

Tested with cmake --warn-unintialized -S . -B build

Description

Avoiding use of uninitialized variables.

Suggested changelog entry:

* CMake: Support running with ``--warn-uninitialized`` active

Tested with cmake --warn-unintialized -S . -B build
@henryiii henryiii added this to the v2.6.2 milestone Jan 18, 2021
Copy link
Collaborator

@YannickJadoul YannickJadoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge as you see fit, I'd say.

If anything, it would even be nice to group stuff at the start and just say "all these settings need to be initialized to """, but ... eh.

@@ -64,6 +64,9 @@ if(EIGEN3_INCLUDE_DIR)
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})

else(EIGEN3_INCLUDE_DIR)
if(NOT DEFINED KDE4_INCLUDE_DIR)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, we can't use possibly_uninitialized here? Ah, too bad. So the solution is already less useful :-)

@YannickJadoul
Copy link
Collaborator

Thanks! Merge as you see fit, I'd say.

@henryiii henryiii closed this Jan 19, 2021
@henryiii henryiii reopened this Jan 19, 2021
@henryiii henryiii merged commit eb83fee into pybind:master Jan 19, 2021
@henryiii henryiii deleted the style/uninit-cmake branch January 19, 2021 23:48
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Jan 19, 2021
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jan 25, 2021
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.

2 participants