This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, pitrou, rhettinger, serhiy.storchaka, skrah, vstinner
Date 2017-09-05.17:10:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> As suggested in it would be better to use
> abort() /* NOT REACHED */

Please don't use abort(), but add a new Py_UNREACHABLE() macro to allow to use a different code depending on the compiler/platform and compiler option (like release vs debug build).

> Can we use compiler-specific code like GCC's __builtin_unreachable()? This would help the optimizer.

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.

Maybe the default implementation of the macro should be:

#define Py_UNREACHABLE(stmt) abort(); stmt

I don't know if it would work.
Date User Action Args
2017-09-05 17:10:24vstinnersetrecipients: + vstinner, barry, rhettinger, pitrou, skrah, serhiy.storchaka
2017-09-05 17:10:24vstinnersetmessageid: <>
2017-09-05 17:10:24vstinnerlinkissue31338 messages
2017-09-05 17:10:24vstinnercreate