diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-05 16:56:36 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-05 16:56:36 (GMT) |
commit | 9a2329f9e116e8bcc82803bbd0ef65b7db083c34 (patch) | |
tree | 0f516d9877e2ae368624f0591e9350b16445bbf7 /Modules/posixmodule.c | |
parent | 7bfb42d5b7721ca26e33050d025fec5c43c00058 (diff) | |
download | cpython-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/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 |