summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-28 12:41:37 (GMT)
committerGitHub <noreply@github.com>2024-06-28 12:41:37 (GMT)
commit43709d5d5424725ec061de2c12c3761affde69ef (patch)
treed37b95065bd4fc00e8b55dfaacbf3d3d18181588 /Include
parentef3c400434eab53e358ebfa5da0411fab722cafb (diff)
downloadcpython-43709d5d5424725ec061de2c12c3761affde69ef.zip
cpython-43709d5d5424725ec061de2c12c3761affde69ef.tar.gz
cpython-43709d5d5424725ec061de2c12c3761affde69ef.tar.bz2
Check for compiler warnings in test_cext on Windows (#121088)
On Windows, test_cext and test_cppext now pass /WX flag to the MSC compiler to treat all compiler warnings as errors. In verbose mode, these tests now log the compiler commands to help debugging. Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a compiler warning about an unnamed structure.
Diffstat (limited to 'Include')
-rw-r--r--Include/pymacro.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index b388c2a..a7945ef 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -46,7 +46,8 @@
/* Argument must be a char or an int in [-128, 127] or [0, 255]. */
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+ && !defined(_MSC_VER))
# define Py_BUILD_ASSERT_EXPR(cond) \
((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), \
0)