GH-131296: move suppression of "unused label" warning for clang-cl on Windows by chris-eibl · Pull Request #131900 · python/cpython · GitHub
Skip to content

GH-131296: move suppression of "unused label" warning for clang-cl on Windows - #131900

Merged
zooba merged 2 commits into
python:mainfrom
chris-eibl:move_unused_label_to_ceval
Apr 10, 2025
Merged

GH-131296: move suppression of "unused label" warning for clang-cl on Windows#131900
zooba merged 2 commits into
python:mainfrom
chris-eibl:move_unused_label_to_ceval

Conversation

@chris-eibl

@chris-eibl chris-eibl commented Mar 30, 2025

Copy link
Copy Markdown
Member

from global pyproject-clangcl.props to ceval.c
Comment thread Python/ceval.c

@chris-eibl chris-eibl Mar 30, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

On Windows, clang-cl does not define __GNUC__ (in contrast to Linux), so let's add __clang__ here.

Slightly further down, for MSVC the same warning (4102) is suppressed using #pragma warning(disable:4102), which clang-cl unfortunately does not understand (yet).

The only occurrences of this warning in the whole code base stem from "generated_cases.c.h", so this is a better place to suppress it in case of clang-cl, instead of doing it globally via pyproject-clangcl.props.

-->
<ExceptionHandling>Async</ExceptionHandling>
<AdditionalOptions>-Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

-Wno-unused-label is moved to ceval.c.

-Wno-deprecated-non-prototype is removed, because it does not "fire" for the whole code base.

@chris-eibl

chris-eibl commented Mar 30, 2025

Copy link
Copy Markdown
Member Author

Failing of *-apple-darwin/clang tail-calling CI is for sure not related to this PR: they are failing since 28th of March (https://github.com/python/cpython/actions/workflows/tail-call.yml).
@Fidget-Spinner any idea?

@Fidget-Spinner

Copy link
Copy Markdown
Member

Failing of *-apple-darwin/clang tail-calling CI is for sure not related to this PR: they are failing since 28th of March (https://github.com/python/cpython/actions/workflows/tail-call.yml). @Fidget-Spinner any idea?

I'm busy right now but from the brief look I did, it seems homebrew changed the directory of where clang 19 is installed. I can only fix it tomorrow, but if you want to take a try you can fix the directory in the CI file today #131895 (comment)

@python-cla-bot

python-cla-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@zooba
zooba merged commit e5f68fd into python:main Apr 10, 2025
@bedevere-bot

Copy link
Copy Markdown

@chris-eibl
chris-eibl deleted the move_unused_label_to_ceval branch April 11, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants