From 74c784a79c6908c14c0c13d6c34db93d9a4d2c8d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 29 Apr 2019 21:28:43 -0400 Subject: treewide: make -Wno-error flags clang-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 724e833ea2a, I was a little too aggressive in enabling these flags. Many don’t work in gcc, and we should probably avoid settings them widely. This makes those flags optional on isclang --- pkgs/tools/archivers/p7zip/default.nix | 2 +- pkgs/tools/compression/pbzip2/default.nix | 2 +- pkgs/tools/networking/ntopng/default.nix | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 3dac4245de4..3b212b186aa 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; - NIX_CFLAGS_COMPILE = "-Wno-error=c++11-narrowing"; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = { homepage = http://p7zip.sourceforge.net/; diff --git a/pkgs/tools/compression/pbzip2/default.nix b/pkgs/tools/compression/pbzip2/default.nix index c7c1b7efc94..1d5cd85a62e 100644 --- a/pkgs/tools/compression/pbzip2/default.nix +++ b/pkgs/tools/compression/pbzip2/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { installFlags = "PREFIX=$(out)"; - NIX_CFLAGS_COMPILE = "-Wno-error=reserved-user-defined-literal"; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal"; meta = with stdenv.lib; { homepage = http://compression.ca/pbzip2/; diff --git a/pkgs/tools/networking/ntopng/default.nix b/pkgs/tools/networking/ntopng/default.nix index b1e1bfcdd65..06d28e844ff 100644 --- a/pkgs/tools/networking/ntopng/default.nix +++ b/pkgs/tools/networking/ntopng/default.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation rec { sed 's|LIBS += -lstdc++.6||' -i Makefile ''; - NIX_CFLAGS_COMPILE = [ "-fpermissive" "-Wno-error=reserved-user-defined-literal" ]; + NIX_CFLAGS_COMPILE = [ "-fpermissive" ] + ++ stdenv.lib.optional stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal"; meta = with stdenv.lib; { description = "High-speed web-based traffic analysis and flow collection tool"; -- cgit 1.4.1