From 0c3c6d879fc462d5be1079c7cc9fcc0aec9d5c83 Mon Sep 17 00:00:00 2001 From: Peter Waller Date: Sun, 16 Jun 2024 15:58:46 +0100 Subject: [PATCH] llvmPackages.clang: don't pass -Wno-maybe-uninitialized to clang If building clang under clang, don't pass -Wno-maybe-uninitialized; this is a gcc-only warning and clang emits a diagnostic for every TU about the unknown warning flag. Signed-off-by: Peter Waller --- pkgs/development/compilers/llvm/common/clang/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index e597ec4d604b..dc175e085f0b 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -198,7 +198,7 @@ let ''; }) // (lib.optionalAttrs (lib.versionAtLeast release_version "15") { - env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.useLLVM) { # The following warning is triggered with (at least) gcc >= # 12, but appears to occur only for cross compiles. NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized";