Clang: Silence warnings (1/3)
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
Singed-off-by: Paul Beeler <sparksco@gmail.com>
diff --git a/lib/ARCMigrate/Android.mk b/lib/ARCMigrate/Android.mk
index 4f142f6..19134b5 100644
--- a/lib/ARCMigrate/Android.mk
+++ b/lib/ARCMigrate/Android.mk
@@ -39,7 +39,7 @@
TransZeroOutPropsInDealloc.cpp
LOCAL_SRC_FILES := $(clang_arc_migrate_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE := libclangARCMigrate
LOCAL_MODULE_TAGS := optional
diff --git a/lib/AST/Android.mk b/lib/AST/Android.mk
index 3e6b79a..e4fe093 100644
--- a/lib/AST/Android.mk
+++ b/lib/AST/Android.mk
@@ -81,7 +81,7 @@
VTableBuilder.cpp
LOCAL_SRC_FILES := $(clang_ast_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangAST
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Analysis/Android.mk b/lib/Analysis/Android.mk
index 9294d0c..ebbf0aa 100644
--- a/lib/Analysis/Android.mk
+++ b/lib/Analysis/Android.mk
@@ -38,7 +38,7 @@
LOCAL_SRC_FILES := $(clang_analysis_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangAnalysis
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Basic/Android.mk b/lib/Basic/Android.mk
index f3972e1..856d291 100644
--- a/lib/Basic/Android.mk
+++ b/lib/Basic/Android.mk
@@ -41,7 +41,7 @@
VersionTuple.cpp
LOCAL_SRC_FILES := $(clang_basic_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangBasic
LOCAL_MODULE_TAGS := optional
diff --git a/lib/CodeGen/Android.mk b/lib/CodeGen/Android.mk
index f7e536d..027c672 100644
--- a/lib/CodeGen/Android.mk
+++ b/lib/CodeGen/Android.mk
@@ -63,7 +63,7 @@
LOCAL_SRC_FILES := $(clang_codegen_SRC_FILES)
TBLGEN_TABLES := $(clang_codegen_TBLGEN_TABLES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_VERSION_INC_MK)
diff --git a/lib/Driver/Android.mk b/lib/Driver/Android.mk
index fe618e2..c296206 100644
--- a/lib/Driver/Android.mk
+++ b/lib/Driver/Android.mk
@@ -32,7 +32,7 @@
WindowsToolChain.cpp
LOCAL_SRC_FILES := $(clang_driver_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE := libclangDriver
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Edit/Android.mk b/lib/Edit/Android.mk
index cdc0ad7..d4d6002 100644
--- a/lib/Edit/Android.mk
+++ b/lib/Edit/Android.mk
@@ -21,7 +21,7 @@
StmtNodes.inc
LOCAL_SRC_FILES := $(clang_edit_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangEdit
diff --git a/lib/Frontend/Android.mk b/lib/Frontend/Android.mk
index 730311e..0d6ed2f 100644
--- a/lib/Frontend/Android.mk
+++ b/lib/Frontend/Android.mk
@@ -53,7 +53,7 @@
VerifyDiagnosticConsumer.cpp
LOCAL_SRC_FILES := $(clang_frontend_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangFrontend
LOCAL_MODULE_TAGS:= optional
diff --git a/lib/FrontendTool/Android.mk b/lib/FrontendTool/Android.mk
index cd57e6a..8e7d539 100644
--- a/lib/FrontendTool/Android.mk
+++ b/lib/FrontendTool/Android.mk
@@ -18,7 +18,7 @@
ExecuteCompilerInvocation.cpp
LOCAL_SRC_FILES := $(clang_frontend_tool_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
diff --git a/lib/Lex/Android.mk b/lib/Lex/Android.mk
index 6cdd3ad..6de9e87 100644
--- a/lib/Lex/Android.mk
+++ b/lib/Lex/Android.mk
@@ -35,7 +35,7 @@
TokenLexer.cpp
LOCAL_SRC_FILES := $(clang_lex_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangLex
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Parse/Android.mk b/lib/Parse/Android.mk
index 50ea216..a3848c8 100644
--- a/lib/Parse/Android.mk
+++ b/lib/Parse/Android.mk
@@ -34,7 +34,7 @@
Parser.cpp
LOCAL_SRC_FILES := $(clang_parse_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangParse
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Rewrite/Core/Android.mk b/lib/Rewrite/Core/Android.mk
index 546fc04..ad58546 100644
--- a/lib/Rewrite/Core/Android.mk
+++ b/lib/Rewrite/Core/Android.mk
@@ -28,6 +28,7 @@
LOCAL_SRC_FILES := $(clang_rewrite_core_SRC_FILES)
+LOCAL_CFLAGS := $(call-cc-cpp-option,-Qunused-arguments)
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
diff --git a/lib/Rewrite/Frontend/Android.mk b/lib/Rewrite/Frontend/Android.mk
index 61200a4..9fd644b 100644
--- a/lib/Rewrite/Frontend/Android.mk
+++ b/lib/Rewrite/Frontend/Android.mk
@@ -32,7 +32,7 @@
LOCAL_SRC_FILES := $(clang_rewrite_frontend_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
diff --git a/lib/Sema/Android.mk b/lib/Sema/Android.mk
index 501a72c..5067d2a 100644
--- a/lib/Sema/Android.mk
+++ b/lib/Sema/Android.mk
@@ -70,7 +70,7 @@
TargetAttributesSema.cpp
LOCAL_SRC_FILES := $(clang_sema_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangSema
LOCAL_MODULE_TAGS := optional
diff --git a/lib/Serialization/Android.mk b/lib/Serialization/Android.mk
index 1c08ad6..33690b3 100644
--- a/lib/Serialization/Android.mk
+++ b/lib/Serialization/Android.mk
@@ -38,7 +38,7 @@
ModuleManager.cpp
LOCAL_SRC_FILES := $(clang_serialization_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
diff --git a/lib/StaticAnalyzer/Checkers/Android.mk b/lib/StaticAnalyzer/Checkers/Android.mk
index 3c68343..1e26fcf 100644
--- a/lib/StaticAnalyzer/Checkers/Android.mk
+++ b/lib/StaticAnalyzer/Checkers/Android.mk
@@ -88,7 +88,7 @@
TBLGEN_TABLES := $(clang_static_analyzer_checkers_TBLGEN_TABLES)
LOCAL_SRC_FILES := $(clang_static_analyzer_checkers_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangStaticAnalyzerCheckers
diff --git a/lib/StaticAnalyzer/Core/Android.mk b/lib/StaticAnalyzer/Core/Android.mk
index ae033ae..b05b92e 100644
--- a/lib/StaticAnalyzer/Core/Android.mk
+++ b/lib/StaticAnalyzer/Core/Android.mk
@@ -57,7 +57,7 @@
TBLGEN_TABLES := $(clang_static_analyzer_core_TBLGEN_TABLES)
LOCAL_SRC_FILES := $(clang_static_analyzer_core_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_MODULE:= libclangStaticAnalyzerCore
diff --git a/lib/StaticAnalyzer/Frontend/Android.mk b/lib/StaticAnalyzer/Frontend/Android.mk
index dc24dfa..68ca3c7 100644
--- a/lib/StaticAnalyzer/Frontend/Android.mk
+++ b/lib/StaticAnalyzer/Frontend/Android.mk
@@ -26,7 +26,7 @@
TBLGEN_TABLES := $(clang_static_analyzer_frontend_TBLGEN_TABLES)
LOCAL_SRC_FILES := $(clang_static_analyzer_frontend_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
LOCAL_C_INCLUDES := $(clang_static_analyzer_frontend_C_INCLUDES)
diff --git a/tools/driver/Android.mk b/tools/driver/Android.mk
index 35ee8d5..4c3dd17 100644
--- a/tools/driver/Android.mk
+++ b/tools/driver/Android.mk
@@ -22,7 +22,7 @@
driver.cpp
LOCAL_SRC_FILES := $(clang_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-c-cpp-option,-Qunused-arguments)
LOCAL_STATIC_LIBRARIES := \
libclangFrontendTool \
diff --git a/utils/TableGen/Android.mk b/utils/TableGen/Android.mk
index e35d50b..df1b175 100644
--- a/utils/TableGen/Android.mk
+++ b/utils/TableGen/Android.mk
@@ -17,7 +17,7 @@
LOCAL_MODULE := clang-tblgen
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(clang_tablegen_SRC_FILES)
-LOCAL_CFLAGS := -fno-strict-aliasing
+LOCAL_CFLAGS := -fno-strict-aliasing $(call-cc-cpp-option,-Qunused-arguments)
REQUIRES_EH := 1
REQUIRES_RTTI := 1