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-120321: Avoid-Wunreachable-code warning on Clang#143022

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
colesbury merged 1 commit intopython:mainfromcolesbury:gh-120321-unused-code
Dec 20, 2025

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commentedDec 20, 2025
edited by bedevere-appbot
Loading

@colesbury
Copy link
ContributorAuthor

I hate this, but I hate the other options even more.

Copy link
Contributor

@mpagempage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We'll end up seeing the warning if clang's analysis gets more capable, right? I guess that's still better than disabling warnings around the block in the default build.

Test failure looks unrelated.

@colesbury
Copy link
ContributorAuthor

We'll end up seeing the warning if clang's analysis gets more capable, right?

I think it's more a matter of convention than capability. Clang can easily optimize through all these things and this warning is only enabled inoptimized builds (not debug builds).

Clang doesn't warn for things like:

if (1) {}unreachable_code; // OK

But it warns for:

if ((expr, 1)) {}unreachable_code; // warning: code will never be executed [-Wunreachable-code]

But not for:

if ((expr, 1) || (1)) {}unreachable_code; // OK

But you can't put that expression in a macro:

#define MACRO (expr, 1) || (1)if (MACRO) {}unreachable_code; // warning: code will never be executed [-Wunreachable-code]

@colesburycolesbury merged commit7607712 intopython:mainDec 20, 2025
87 of 89 checks passed
@colesburycolesbury deleted the gh-120321-unused-code branchDecember 20, 2025 19:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mpagempagempage approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon 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.

2 participants

@colesbury@mpage

[8]ページ先頭

©2009-2025 Movatter.jp