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

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

Merged
vstinner merged 6 commits intopython:mainfromvstinner:fallthrough
Jun 27, 2024

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedJun 26, 2024
edited by bedevere-appbot
Loading

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.

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
Copy link
MemberAuthor

cc@sobolevn

Copy link
Member

@sobolevnsobolevn left a 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) :)

@vstinner
Copy link
MemberAuthor

Looks like you need to run make regen-cases (or maybe even make regen-all) :)

Done.

@mdboom
Copy link
Contributor

Maybe of interest to@nohlson.

No longer define __has_attribute() if it's not defined.Move also _Py__has_builtin() at the top of pyport.h.
Copy link
Member

@ericsnowcurrentlyericsnowcurrently left a 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.

@brettcannonbrettcannon removed their request for reviewJune 26, 2024 17:35
@vstinnervstinnerenabled auto-merge (squash)June 27, 2024 09:38
@vstinner
Copy link
MemberAuthor

I tested my change with-Wimplicit-fallthrough=5 which ignores all comments. There are only remaining comments onModules/expat/ when--with-system-expat is not used, not in the Python code base anymore.

See also the article about the flag:https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7

@vstinnervstinner merged commit12af8ec intopython:mainJun 27, 2024
@vstinnervstinner deleted the fallthrough branchJune 27, 2024 09:58
mrahtz pushed a commit to mrahtz/cpython that referenced this pull requestJun 30, 2024
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>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
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>
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sobolevnsobolevnsobolevn left review comments

@AlexWaygoodAlexWaygoodAlexWaygood left review comments

@ericsnowcurrentlyericsnowcurrentlyericsnowcurrently approved these changes

@corona10corona10Awaiting requested review from corona10corona10 is a code owner

@ncoghlanncoghlanAwaiting requested review from ncoghlanncoghlan is a code owner

@warsawwarsawAwaiting requested review from warsawwarsaw is a code owner

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

@tirantiranAwaiting requested review from tiran

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@vstinner@mdboom@ericsnowcurrently@sobolevn@corona10@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp