Clang: Remove some warning flags provided by LLVM

Clang unit tests produce many warnings with GCC8 and
these flags (-Wnon-virtual-dtor, -Woverloaded-virtual).

Change-Id: I54a4c9c5b2f12da3c3898fc6f3beca0d4dfe478c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Orgad Shaneh
2018-11-14 23:31:09 +02:00
committed by Orgad Shaneh
parent 3b30bfa35f
commit 91649cf274
2 changed files with 16 additions and 4 deletions

View File

@@ -161,6 +161,17 @@ function toolingParameters(llvmConfig)
cxxFlags: [],
};
var allCxxFlags = readListOutput(llvmConfig, ["--cxxflags"]);
var badFlags = [
"-fno-exceptions",
"/W4",
"-Wcovered-switch-default",
"-Wnon-virtual-dtor",
"-Woverloaded-virtual",
"-fPIC",
"-pedantic",
"-Wstring-conversion",
"-gsplit-dwarf"
]
for (var i = 0; i < allCxxFlags.length; ++i) {
var flag = allCxxFlags[i];
if (flag.startsWith("-D") || flag.startsWith("/D")) {
@@ -173,10 +184,9 @@ function toolingParameters(llvmConfig)
}
if (!flag.startsWith("-std") && !flag.startsWith("-O") && !flag.startsWith("/O")
&& !flag.startsWith("-march")
&& !flag.startsWith("/EH") && flag !== "-fno-exceptions"
&& flag !== "/W4" && flag !== "-Werror=date-time"
&& flag !== "-Wcovered-switch-default" && flag !== "-fPIC" && flag !== "-pedantic"
&& flag !== "-Wstring-conversion" && flag !== "-gsplit-dwarf") {
&& !flag.startsWith("-Werror=")
&& !flag.startsWith("/EH")
&& !badFlags.contains(flag)) {
params.cxxFlags.push(flag);
}
}

View File

@@ -228,6 +228,8 @@ isEmpty(LLVM_VERSION) {
LLVM_CXXFLAGS ~= s,/G\S*,
LLVM_CXXFLAGS ~= s,-Werror=\S*,
LLVM_CXXFLAGS ~= s,-Wcovered-switch-default,
LLVM_CXXFLAGS ~= s,-Wnon-virtual-dtor,
LLVM_CXXFLAGS ~= s,-Woverloaded-virtual,
LLVM_CXXFLAGS ~= s,-fPIC,
LLVM_CXXFLAGS ~= s,-pedantic,
LLVM_CXXFLAGS ~= s,-Wstring-conversion,