Skip to content

Commit 5405e9e

Browse files
authored
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.
1 parent 039d20a commit 5405e9e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/test/test_cext/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# gh-116869: Build a basic C test extension to check that the Python C API
22
# does not emit C compiler warnings.
3+
#
4+
# Python C API must build with -Werror=declaration-after-statement.
35

46
import os.path
57
import shutil

Lib/test/test_cext/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
# The purpose of test_cext extension is to check that building a C
1717
# extension using the Python C API does not emit C compiler warnings.
1818
'-Werror',
19+
20+
# gh-116869: The Python C API must build with
21+
# -Werror=declaration-after-statement.
22+
'-Werror=declaration-after-statement',
1923
]
2024
else:
2125
# Don't pass any compiler flag to MSVC

0 commit comments

Comments
 (0)