Uh oh!
There was an error while loading. Please reload this page.
gh-121040: Use __attribute__((fallthrough)) - #121044
Conversation
Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Fix warnings when using -Wimplicit-fallthrough compiler flag.
vstinner
commented
Jun 26, 2024
cc @sobolevn |
sobolevn
left a comment
There was a problem hiding this comment.
Looks like you need to run make regen-cases (or maybe even make regen-all) :)
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Jun 26, 2024
Done. |
mdboom
commented
Jun 26, 2024
Maybe of interest to @nohlson. |
Uh oh!
There was an error while loading. Please reload this page.
No longer define __has_attribute() if it's not defined. Move also _Py__has_builtin() at the top of pyport.h.
ericsnowcurrently
left a comment
There was a problem hiding this comment.
LGTM
I left one small comment where you might consider a slightly different spelling, but I'll leave that up to you.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Jun 27, 2024
I tested my change with See also the article about the flag: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7 |
Fix warnings when using -Wimplicit-fallthrough compiler flag. Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Replace "fall through" comments with _Py_FALLTHROUGH. Add _Py__has_attribute() macro. No longer define __has_attribute() macro if it's not defined. Move also _Py__has_builtin() at the top of pyport.h. Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
Fix warnings when using -Wimplicit-fallthrough compiler flag. Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Replace "fall through" comments with _Py_FALLTHROUGH. Add _Py__has_attribute() macro. No longer define __has_attribute() macro if it's not defined. Move also _Py__has_builtin() at the top of pyport.h. Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
Fix warnings when using -Wimplicit-fallthrough compiler flag. Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Replace "fall through" comments with _Py_FALLTHROUGH. Add _Py__has_attribute() macro. No longer define __has_attribute() macro if it's not defined. Move also _Py__has_builtin() at the top of pyport.h. Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses attribute((fallthrough)) if available.
Fix warnings when using -Wimplicit-fallthrough compiler flag.