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>
This commit is contained in:
Jack Nagel 2012-02-18 12:25:23 -06:00
parent 78d4fda6d6
commit f8e3e806f9

View File

@ -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