[issue31338] Use abort() for code we never expect to hit

Stefan Krah report at bugs.python.org
Tue Sep 5 14:17:40 EDT 2017


Stefan Krah added the comment:

On Tue, Sep 05, 2017 at 05:10:24PM +0000, STINNER Victor wrote:
> That's a good example of better implementation for Py_UNREACHABLE().
> 
> The tricky part is to make compiler warnings quiet. For example, you cannot replace "abort(); return NULL;" with "abort()", because a function without return would emit a warning.

Which compiler needs more than "abort();" in a default statement? gcc and clang
don't.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31338>
_______________________________________


More information about the Python-bugs-list mailing list