mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #28152: Fix -Wunreachable-code warnings on Clang
Don't declare dead code when the code is declared with Clang.
This commit is contained in:
parent
7bfb42d5b7
commit
9a2329f9e1
2 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue