lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

python3Packages.cffi: fix build with newer clang

cffi uses a technique to find the offset of a struct that causes newer
clangs to issue a warning regarding null pointer subtraction. This
patch silences the warning, so cffi can build.

+17
+11
pkgs/development/python-modules/cffi/clang-pointer-substraction-warning.diff
··· 1 + diff -r c649a735cf82 testing/support.py 2 + --- a/testing/support.py Thu Feb 23 05:42:01 2023 +0100 3 + +++ b/testing/support.py Sat May 20 21:46:56 2023 -0400 4 + @@ -112,6 +112,7 @@ 5 + '-Wno-unreachable-code'] 6 + # special things for clang 7 + extra_compile_args.append('-Qunused-arguments') 8 + + extra_compile_args.append('-Wno-null-pointer-subtraction') 9 + else: 10 + # assume a standard gcc 11 + extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion',
+6
pkgs/development/python-modules/cffi/default.nix
··· 50 50 ]; 51 51 hash = "sha256-+2daRTvxtyrCPimOEAmVbiVm1Bso9hxGbaAbd03E+ws="; 52 52 }) 53 + ] ++ lib.optionals (stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion stdenv.cc) "13") [ 54 + # -Wnull-pointer-subtraction is enabled with -Wextra. Suppress it to allow the following tests 55 + # to run and pass when cffi is built with newer versions of clang: 56 + # - testing/cffi1/test_verify1.py::test_enum_usage 57 + # - testing/cffi1/test_verify1.py::test_named_pointer_as_argument 58 + ./clang-pointer-substraction-warning.diff 53 59 ] ++ lib.optionals (pythonAtLeast "3.11") [ 54 60 # Fix test that failed because python seems to have changed the exception format in the 55 61 # final release. This patch should be included in the next version and can be removed when