diff --git a/Lib/test/test_cext/__init__.py b/Lib/test/test_cext/__init__.py index 730b91abfb2715..77929495336638 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 dd57a5fb8e1e1b..aed7e6d46dd8d0 100644 --- a/Lib/test/test_cext/setup.py +++ b/Lib/test/test_cext/setup.py @@ -16,6 +16,10 @@ # 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