From ca6b42c18314240b42b915c182640f06937ea100 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 23 Jan 2025 09:37:46 +0100 Subject: [PATCH] phps: Remove redundant CFLAGS Drop the flags that are not necessary for compilation to succeed. Also switch to `-Wno-error=`. As per : -Werror Make all warnings into errors. -Werror= Make the specified warning into an error. The specifier for a warning is appended; for example -Werror=switch turns the warnings controlled by -Wswitch into errors. This switch takes a negative form, to be used to negate -Werror for specific warnings; for example -Wno-error=switch makes -Wswitch warnings not be errors, even when -Werror is in effect. --- pkgs/phps.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/phps.nix b/pkgs/phps.nix index 6c27d5c..a46e18c 100644 --- a/pkgs/phps.nix +++ b/pkgs/phps.nix @@ -100,19 +100,19 @@ let let extraCompileFlags = lib.optionals prev.stdenv.cc.isClang ( # Downgrade the following errors to warnings. - lib.optionals (lib.versionOlder args.version "8.2") [ - "-Wno-compare-distinct-pointer-types" - "-Wno-implicit-const-int-float-conversion" - "-Wno-deprecated-declarations" - "-Wno-incompatible-function-pointer-types" - "-Wno-incompatible-pointer-types-discards-qualifiers" + lib.optionals (lib.versionOlder args.version "8.1") [ + # error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types] + "-Wno-error=incompatible-function-pointer-types" ] - ++ lib.optionals (lib.versionOlder args.version "8.0") [ - "-Wno-implicit-int" - "-Wno-implicit-function-declaration" + ++ lib.optionals (lib.versionOlder args.version "7.3") [ + # error: too few arguments to function call, expected 3, have 2 (readdir_r) + # Not sure why these two are not required on 7.3 + "-Wno-error=implicit-int" + "-Wno-error=implicit-function-declaration" ] - ++ lib.optionals (lib.versionAtLeast args.version "7.3" && lib.versionOlder args.version "7.4") [ - "-Wno-int-conversion" + ++ lib.optionals (lib.versionAtLeast args.version "7.2" && lib.versionOlder args.version "7.4") [ + # error: too few arguments to function call, expected 3, have 2 (readdir_r) + "-Wno-error=int-conversion" ] ); in