py/misc: Don't warn about a GNU extension for static assert macro.

This warning was enabled by default on clang 17.0.0 on macOS 26.  Disable
it, because we want to make these checks at compile-time even if it
requires an extension.

Fixes issue #18116.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This commit is contained in:
Jeff Epler
2025-09-27 19:29:49 -05:00
committed by Damien George
parent 099991f3ef
commit 33cf1ab3cc

View File

@@ -83,6 +83,9 @@ typedef unsigned int uint;
#if defined(_MSC_VER) || defined(__cplusplus)
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)1)
#else
#if __clang__
#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
#endif
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
#endif