From 8da28a1295e8601f9af0175cc23072452849b131 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Feb 27 2018 16:20:32 +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 566c54b..a375f48 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: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages Requires: %{python}-libs%{?_isa} = %{version}-%{release} @@ -754,6 +754,14 @@ Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch # Fixed upstream: https://bugs.python.org/issue32186 Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.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., @@ -1077,6 +1085,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c %patch284 -p1 %patch285 -p1 %patch287 -p1 +%patch297 -p1 %if 0%{?_module_build} @@ -1968,7 +1977,10 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Thu Feb 15 2018 Miro Hrončok - 2.7.14-17 +* Mon Feb 26 2018 Petr Viktorin - 2.7.14-8 +- Fix -Wint-in-bool-context warnings + +* Thu Feb 15 2018 Miro Hrončok - 2.7.14-7 - Move test.support and test.script_helper to python2-libs Resolves: rhbz#1528899