Make sure that the C API does not emit compiler warnings when built
with -Werror=declaration-after-statement.
# gh-116869: Build a basic C test extension to check that the Python C API
# does not emit C compiler warnings.
+#
+# Python C API must build with -Werror=declaration-after-statement.
import os.path
import shutil
# The purpose of test_cext extension is to check that building a C
# extension using the Python C API does not emit C compiler warnings.
'-Werror',
+
+ # gh-116869: The Python C API must build with
+ # -Werror=declaration-after-statement.
+ '-Werror=declaration-after-statement',
]
else:
# Don't pass any compiler flag to MSVC