Clang: Silence warnings
With GCC >=4.7 Clang generates a lot of noise with various compiler flags,
and can even break the builds when using Flags like Graphite. This can be
reproduced by doing the following:
Setting TARGET_EXTRA_CFLAGS with Graphite flags such as these
TARGET_EXTRA_CFLAGS += -fgraphite-identity \
-floop-block \
-floop-strip-mine \
-ftree-loop-distribution \
-ftree-loop-linear
Causes the following errors to occure and the builds to fail:
clang: error: argument unused during compilation: '-fgraphite-identity'
'-floop-block'
'-floop-strip-mine'
'-ftree-loop-distribution'
'-ftree-loop-linear'
Silence the errors by passing the -Qunused-arguments for CFLAGS
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/Android.mk b/Android.mk
index 2a56378..e2410f6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH:=$(call my-dir)
-rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable
+rs_base_CFLAGS := -Werror -Wall -Wno-unused-parameter -Wno-unused-variable $(call-cc-cpp-option,-Qunused-arguments)
# For gcc 4.7, C++11 narrowing is a warning...
rs_base_CFLAGS += -Wno-error
ifeq ($(TARGET_BUILD_PDK), true)
diff --git a/cpp/Android.mk b/cpp/Android.mk
index 145f487..a03a5de 100644
--- a/cpp/Android.mk
+++ b/cpp/Android.mk
@@ -34,6 +34,8 @@
LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := $(call-cc-cpp-option,-Qunused-arguments)
+
intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
librs_generated_headers := \
$(intermediates)/rsgApiStructs.h \