Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PCbuild/pyproject-clangcl.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Please see GH-131691 for details.
-->
<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
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.

<AdditionalOptions Condition="'$(Platform)' == 'Win32'">-m32 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)' == 'x64'">-m64 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="$(Configuration) != 'Debug'">-flto=thin %(AdditionalOptions)</AdditionalOptions>
Expand Down
4 changes: 2 additions & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ extern void _PyUOpPrint(const _PyUOpInstruction *uop);
if computed gotos aren't used. */

/* TBD - what about other compilers? */
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
Copy link
Member Author

@chris-eibl chris-eibl Mar 30, 2025

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.

# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-label"
#elif defined(_MSC_VER) /* MS_WINDOWS */
Expand Down Expand Up @@ -1168,7 +1168,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
# pragma optimize("", on)
#endif

#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
# pragma GCC diagnostic pop
#elif defined(_MSC_VER) /* MS_WINDOWS */
# pragma warning(pop)
Expand Down
Loading