summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-05 16:56:36 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-05 16:56:36 (GMT)
commit9a2329f9e116e8bcc82803bbd0ef65b7db083c34 (patch)
tree0f516d9877e2ae368624f0591e9350b16445bbf7 /Modules/faulthandler.c
parent7bfb42d5b7721ca26e33050d025fec5c43c00058 (diff)
downloadcpython-9a2329f9e116e8bcc82803bbd0ef65b7db083c34.zip
cpython-9a2329f9e116e8bcc82803bbd0ef65b7db083c34.tar.gz
cpython-9a2329f9e116e8bcc82803bbd0ef65b7db083c34.tar.bz2
Issue #28152: Fix -Wunreachable-code warnings on Clang
Don't declare dead code when the code is declared with Clang.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 1c1e4fb..ac6ab7e 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -980,12 +980,21 @@ faulthandler_sigsegv(PyObject *self, PyObject *args)
static void
faulthandler_fatal_error_thread(void *plock)
{
+#ifndef __clang__
PyThread_type_lock *lock = (PyThread_type_lock *)plock;
+#endif
Py_FatalError("in new thread");
+#ifndef __clang__
+ /* Issue #28152: Py_FatalError() is declared with
+ __attribute__((__noreturn__)). GCC emits a warning without
+ "PyThread_release_lock()" (compiler bug?), but Clang is smarter and
+ emits a warning on the return. */
+
/* notify the caller that we are done */
PyThread_release_lock(lock);
+#endif
}
static PyObject *