Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3694a1

Browse files
committed
bpo-41875: Use __builtin_unreachable when possible
1 parenta937ab4 commitc3694a1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎Include/pymacro.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@
118118
"We've reached an unreachable state. Anything is possible.\n" \
119119
"The limits were in our heads all along. Follow your dreams.\n" \
120120
"https://xkcd.com/2200")
121-
#elif defined(__GNUC__)|| defined(__clang__)|| defined(__INTEL_COMPILER)
121+
#elif defined(__GNUC__)&& (__GNUC__>4|| (__GNUC__==4&&__GNUC_MINOR__ >=5))
122+
# definePy_UNREACHABLE() __builtin_unreachable()
123+
#elif defined(__clang__)|| defined(__INTEL_COMPILER)
122124
# definePy_UNREACHABLE() __builtin_unreachable()
123125
#elif defined(_MSC_VER)
124126
# definePy_UNREACHABLE() __assume(0)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp