diff --git a/setup.py b/setup.py index 7ee2353b5a..2f63310d63 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,10 @@ on_rtd = os.environ.get("READTHEDOCS") # Extra cflags for all extensions, usually just warnings we want to enable explicitly -cflags = ["-Wall", "-Wextra", "-Wpointer-arith", "-Wno-unreachable-code-fallthrough"] +cflags = ["-Wall", "-Wextra", "-Wpointer-arith", "-Wno-implicit-fallthrough"] + +if not is_win32: + cflags.extend(["-Wstrict-prototypes"]) compress_source = "src/borg/compress.pyx" crypto_ll_source = "src/borg/crypto/low_level.pyx" @@ -225,7 +228,8 @@ def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_s if cythonize and cythonizing: # 3str is the default in Cython3 and we do not support older Cython releases. # we only set this to avoid the related FutureWarning from Cython3. - cython_opts = dict(compiler_directives={"language_level": "3str"}) + cython_opts = dict(compiler_directives={"language_level": "3str", "warn.unreachable": True}) + if not is_win32: # Compile .pyx extensions to .c in parallel; does not work on Windows cython_opts["nthreads"] = cpu_threads