Skip to content

Commit

Permalink
pythongh-116869: Build test_cext with -Werror=declaration-after-state…
Browse files Browse the repository at this point in the history
…ment (python#116990)

Make sure that the C API does not emit compiler warnings when built
with -Werror=declaration-after-statement.
  • Loading branch information
vstinner authored Mar 19, 2024
1 parent 039d20a commit 5405e9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_cext/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_cext/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5405e9e

Please sign in to comment.