diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/faulthandler.c | 9 | ||||
-rw-r--r-- | Modules/posixmodule.c | 5 |
2 files changed, 14 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 * diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2e9eb9e..bec7699 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -10337,8 +10337,13 @@ os_abort_impl(PyObject *module) { abort(); /*NOTREACHED*/ +#ifndef __clang__ + /* Issue #28152: abort() is declared with __attribute__((__noreturn__)). + GCC emits a warning without "return NULL;" (compiler bug?), but Clang + is smarter and emits a warning on the return. */ Py_FatalError("abort() called from Python code didn't abort!"); return NULL; +#endif } #ifdef MS_WINDOWS |