diff options
author | Victor Stinner <vstinner@python.org> | 2024-03-19 11:05:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 11:05:22 (GMT) |
commit | 5405e9e5b51f3bd883aee5c1a52a39a56e2fb2b4 (patch) | |
tree | 3f35db91e74584afc049fe9c2f41a06b21736a23 | |
parent | 039d20ae5428dfe3d70404d8a5297c70d41e2e2d (diff) | |
download | cpython-5405e9e5b51f3bd883aee5c1a52a39a56e2fb2b4.zip cpython-5405e9e5b51f3bd883aee5c1a52a39a56e2fb2b4.tar.gz cpython-5405e9e5b51f3bd883aee5c1a52a39a56e2fb2b4.tar.bz2 |
gh-116869: Build test_cext with -Werror=declaration-after-statement (#116990)
Make sure that the C API does not emit compiler warnings when built
with -Werror=declaration-after-statement.
-rw-r--r-- | Lib/test/test_cext/__init__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_cext/setup.py | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_cext/__init__.py b/Lib/test/test_cext/__init__.py index 730b91a..7792949 100644 --- a/Lib/test/test_cext/__init__.py +++ b/Lib/test/test_cext/__init__.py @@ -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 diff --git a/Lib/test/test_cext/setup.py b/Lib/test/test_cext/setup.py index dd57a5f..aed7e6d 100644 --- a/Lib/test/test_cext/setup.py +++ b/Lib/test/test_cext/setup.py @@ -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 |