From 5316098666073320fec50e1bbf3a2b40a19df4ee Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Feb 27 2018 10:07:57 +0000 Subject: Fix -Wint-in-bool-context warnings --- diff --git a/00297-fix-int-in-bool-context-warnings.patch b/00297-fix-int-in-bool-context-warnings.patch new file mode 100644 index 0000000..4f29f37 --- /dev/null +++ b/00297-fix-int-in-bool-context-warnings.patch @@ -0,0 +1,24 @@ +commit fd39e2a6845f33a74fbb0671c434c0d84a5ec2f3 +Author: Christian Heimes +Date: Fri Sep 15 20:27:23 2017 +0200 + + bpo-31474: Fix -Wint-in-bool-context warnings (#3581) + + Signed-off-by: Christian Heimes + +diff --git a/Include/pymem.h b/Include/pymem.h +index 10b5bea5eb..2c239df590 100644 +--- a/Include/pymem.h ++++ b/Include/pymem.h +@@ -72,9 +72,9 @@ PyAPI_FUNC(void) PyMem_Free(void *); + /* Returns NULL to indicate error if a negative size or size larger than + Py_ssize_t can represent is supplied. Helps prevents security holes. */ + #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ +- : malloc((n) ? (n) : 1)) ++ : malloc(((n) != 0) ? (n) : 1)) + #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ +- : realloc((p), (n) ? (n) : 1)) ++ : realloc((p), ((n) != 0) ? (n) : 1)) + #define PyMem_FREE free + + #endif /* PYMALLOC_DEBUG */ diff --git a/python2.spec b/python2.spec index 474da3b..37f5803 100644 --- a/python2.spec +++ b/python2.spec @@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming language Name: %{python} # Remember to also rebase python-docs when changing this: Version: 2.7.14 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages Requires: %{python}-libs%{?_isa} = %{version}-%{release} @@ -773,6 +773,14 @@ Patch289: 00289-disable-nis-detection.patch # See https://bugzilla.redhat.com/show_bug.cgi?id=1540316 Patch293: 00293-fix-gc-alignment.patch +# 00297 # +# Fix -Wint-in-bool-context warnings that show up when compiling Python +# (and, more importantly, Python libraries) with newer GCC. +# See https://bugzilla.redhat.com/show_bug.cgi?id=1473425 +# Fixed upstream: https://github.com/python/cpython/pull/3581 +Patch297: 00297-fix-int-in-bool-context-warnings.patch + + # (New patches go here ^^^) # # When adding new patches to "python2" and "python3" in Fedora, EL, etc., @@ -1098,6 +1106,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c %patch288 -p1 %patch289 -p1 %patch293 -p1 +%patch297 -p1 %if 0%{?_module_build} @@ -1976,6 +1985,10 @@ CheckPython \ # ====================================================== %changelog +* Mon Feb 26 2018 Petr Viktorin - 2.7.14-13 +- Fix -Wint-in-bool-context warnings +Resolves: rhbz#1473425 + * Sat Feb 24 2018 Florian Weimer - 2.7.14-12 - Rebuild with new LDFLAGS from redhat-rpm-config