aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-02-18 12:25:23 -0600
committerJack Nagel2012-02-21 00:22:17 -0600
commitb1f5faea0a75a14a1b7f1a4547906185fe47cd8e (patch)
tree2c85d0648f2c95e485f412cb66a8ceeb3ee20202 /Library
parent3d3d7c6c8867d84b8d4eb11152efd813255b933b (diff)
downloadhomebrew-b1f5faea0a75a14a1b7f1a4547906185fe47cd8e.tar.bz2
Silence unused argument warnings from clang
The clang frontend ignores a number of options that are accepted by gcc and llvm-gcc. However, it produces a warning for each unused argument at each invocation, which can result in many lines of noise, e.g. clang: warning: argument unused during compilation: '-rdynamic' Since these arguments do not affect compilation, let's just silence the warnings by passing '-Qunused-arguments' to clang by default. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index eb6af9ccc..146c25755 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -163,6 +163,7 @@ module HomebrewEnvExtension
replace_in_cflags(/-Xarch_i386 (-march=\S*)/, '\1')
# Clang mistakenly enables AES-NI on plain Nehalem
set_cpu_cflags 'native', :nehalem => 'native -Xclang -target-feature -Xclang -aes'
+ append_to_cflags '-Qunused-arguments'
@compiler = :clang
end
@@ -347,6 +348,9 @@ Please take one of the following actions:
# Don't set -msse3 and older flags because -march does that for us
append_to_cflags '-march=' + map.fetch(Hardware.intel_family, default)
end
+
+ # not really a 'CPU' cflag, but is only used with clang
+ remove_from_cflags %r{ -Qunused-arguments}
end
# actually c-compiler, so cc would be a better name