summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-05 17:00:42 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-05 17:00:42 (GMT)
commit408bfa6d96456a7c3621e5c6d249d3fac337a78b (patch)
treeba48f0c57864d5f6e7c34fd52f40147ce9aebb80 /Modules/_multiprocessing
parent44d9bea1b823ed1ac25a78bb350b03848e59ac80 (diff)
downloadcpython-408bfa6d96456a7c3621e5c6d249d3fac337a78b.zip
cpython-408bfa6d96456a7c3621e5c6d249d3fac337a78b.tar.gz
cpython-408bfa6d96456a7c3621e5c6d249d3fac337a78b.tar.bz2
Issue #28152: Fix -Wunreachable-code warning on clang
Replace 0 with (0) to ignore a compiler warning about dead code on "((int)(SEM_VALUE_MAX) < 0)": SEM_VALUE_MAX is not negative on Linux.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/multiprocessing.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index d92a8bf..bb65b3b 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -171,8 +171,11 @@ PyInit__multiprocessing(void)
{
PyObject *py_sem_value_max;
/* Some systems define SEM_VALUE_MAX as an unsigned value that
- * causes it to be negative when used as an int (NetBSD). */
- if ((int)(SEM_VALUE_MAX) < 0)
+ * causes it to be negative when used as an int (NetBSD).
+ *
+ * Issue #28152: Use (0) instead of 0 to fix a warning on dead code
+ * when using clang -Wunreachable-code. */
+ if ((int)(SEM_VALUE_MAX) < (0))
py_sem_value_max = PyLong_FromLong(INT_MAX);
else
py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX);