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

bpo-31474: Fix -Wint-in-bool-context warnings #3581

Merged
merged 1 commit into from Sep 15, 2017

Conversation

tiran
Copy link
Member

@tiran tiran commented Sep 14, 2017

@tiran tiran added the type-bug An unexpected behavior, bug, or error label Sep 14, 2017
@@ -572,7 +572,7 @@ fill_number(STRINGLIB_CHAR *buf, const NumberFieldWidths *spec,
if (spec->n_sign == 1) {
*buf++ = spec->sign;
}
if (spec->n_prefix) {
if (spec->n_prefix && prefix) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that prefix is NULL?

Copy link
Member Author

Choose a reason for hiding this comment

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

format_float_internal() calls the fill function with prefix=NULL.

Signed-off-by: Christian Heimes <christian@python.org>
@tiran tiran changed the title bpo-31474: Fix -Wnonnull and -Wint-in-bool-context warnings bpo-31474: Fix -Wint-in-bool-context warnings Sep 15, 2017
@tiran
Copy link
Member Author

tiran commented Sep 15, 2017

I'm going to fix the -Wint-in-bool-context warnings first as they are most annoying. Let's figure out the other warnings in a different PR.

@tiran tiran merged commit fd39e2a into python:2.7 Sep 15, 2017
@tiran tiran deleted the bpo-31474-warnings branch September 15, 2017 18:27
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants