Commit 28cbe19c authored by Christoph Reiter's avatar Christoph Reiter 🐍

build: don't use -Wdeclaration-after-statement with Python 3

The headers of Python 3.8 trigger the warning and PEP7 states that
Python is depending on this now.

As far as I remember this was mostly added to keep the code compatible
with ancient py2 MSVC, so only use it with Python 2.
parent 179e04b2
Pipeline #88195 passed with stages
in 12 minutes and 43 seconds
......@@ -72,7 +72,6 @@ else
'-Wall',
'-Warray-bounds',
'-Wcast-align',
'-Wdeclaration-after-statement',
'-Wduplicated-branches',
'-Wextra',
'-Wformat=2',
......@@ -104,6 +103,12 @@ else
'-Wwrite-strings',
]
if python.language_version().split('.')[0] == '2'
main_c_args += [
'-Wdeclaration-after-statement',
]
endif
main_c_args += [
'-Wno-incompatible-pointer-types-discards-qualifiers',
'-Wno-missing-field-initializers',
......
......@@ -975,7 +975,6 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
"-Wall",
"-Warray-bounds",
"-Wcast-align",
"-Wdeclaration-after-statement",
"-Wduplicated-branches",
"-Wextra",
"-Wformat=2",
......@@ -1007,6 +1006,11 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
"-Wwrite-strings",
]
if sys.version_info[0] == 2:
args += [
"-Wdeclaration-after-statement",
]
args += [
"-Wno-incompatible-pointer-types-discards-qualifiers",
"-Wno-missing-field-initializers",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment