From f8e3e806f9a8a8660d15fbd2aef5459944d965b0 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 18 Feb 2012 12:25:23 -0600 Subject: 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 --- Library/Homebrew/extend/ENV.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Library') 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 -- cgit v1.2.3