Skip to content

Commit 33cf1ab

Browse files
jeplerdpgeorge
authored andcommitted
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 <[email protected]>
1 parent 099991f commit 33cf1ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

py/misc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ typedef unsigned int uint;
8383
#if defined(_MSC_VER) || defined(__cplusplus)
8484
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)1)
8585
#else
86+
#if __clang__
87+
#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
88+
#endif
8689
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
8790
#endif
8891

0 commit comments

Comments
 (0)