Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-121040: Use __attribute__((fallthrough))#121044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Annotate explicitly "fall through" switch cases with a new_Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) ifavailable.Fix warnings when using -Wimplicit-fallthrough compiler flag.
vstinner commentedJun 26, 2024
sobolevn left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks like you need to runmake regen-cases (or maybe evenmake regen-all) :)
Uh oh!
There was an error while loading.Please reload this page.
vstinner commentedJun 26, 2024
Done. |
mdboom commentedJun 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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 commentedJun 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)) ifavailable. 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 topof 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)) ifavailable. 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 topof 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)) ifavailable. 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 topof pyport.h.Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
Uh oh!
There was an error while loading.Please reload this page.
Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which usesattribute((fallthrough)) if available.
Fix warnings when using -Wimplicit-fallthrough compiler flag.