Skip to content

Commit

Permalink
phps: Remove redundant CFLAGS
Browse files Browse the repository at this point in the history
Drop the flags that are not necessary for compilation to succeed.

Also switch to `-Wno-error=`. As per <https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Werror>:

    -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.
  • Loading branch information
jtojnar committed Jan 23, 2025
1 parent c948675 commit ca6b42c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkgs/phps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca6b42c

Please sign in to comment.