]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116869: Build test_cext with -Werror=declaration-after-statement (#116990)
authorVictor Stinner <vstinner@python.org>
Tue, 19 Mar 2024 11:05:22 +0000 (12:05 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2024 11:05:22 +0000 (12:05 +0100)
Make sure that the C API does not emit compiler warnings when built
with -Werror=declaration-after-statement.

Lib/test/test_cext/__init__.py
Lib/test/test_cext/setup.py

index 730b91abfb27156445d9cf872b5e7cf06dc1a7d9..77929495336638edd3d91fa04577455412315a4c 100644 (file)
@@ -1,5 +1,7 @@
 # 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
index dd57a5fb8e1e1bb1af082b5899619fe041cad64a..aed7e6d46dd8d06533119946a7a0aa9b47f6def1 100644 (file)
@@ -16,6 +16,10 @@ if not support.MS_WINDOWS:
         # 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