We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a937ab4 commit c3694a1Copy full SHA for c3694a1
Include/pymacro.h
@@ -118,7 +118,9 @@
118
"We've reached an unreachable state. Anything is possible.\n" \
119
"The limits were in our heads all along. Follow your dreams.\n" \
120
"https://xkcd.com/2200")
121
-#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
122
+# define Py_UNREACHABLE() __builtin_unreachable()
123
+#elif defined(__clang__) || defined(__INTEL_COMPILER)
124
# define Py_UNREACHABLE() __builtin_unreachable()
125
#elif defined(_MSC_VER)
126
# define Py_UNREACHABLE() __assume(0)
Misc/NEWS.d/next/C API/2020-09-28-21-56-51.bpo-38249.uzMCaZ.rst
@@ -0,0 +1,2 @@
1
+Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable() if only the
2
+compiler is able to use it. Patch by Dong-hee Na.
0 commit comments