summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-11 23:36:49 +0800
committerGitHub <[email protected]>2020-11-11 23:36:49 +0800
commit8720d7ba6d82aacd3b6953596ef2687c3368120e (patch)
tree4f5a0e7b8f5760ac664e84b656f646265ff94d5a
parenta027a704b2799c402f983cf373f689d0d9c6efdc (diff)
parent58d160914919331ca121c2648ce72947b816d127 (diff)
Merge pull request #1025 from SirLynix/fix-warnings
Enable more warnings on "all" settings
-rw-r--r--xmake/modules/core/tools/cl.lua1
-rw-r--r--xmake/modules/core/tools/clang.lua1
-rw-r--r--xmake/modules/core/tools/clang_cl.lua2
-rw-r--r--xmake/modules/core/tools/gcc.lua1
-rw-r--r--xmake/modules/core/tools/nvcc.lua2
-rw-r--r--xmake/modules/core/tools/tcc.lua4
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua22
7 files changed, 20 insertions, 13 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index d24ef5901..371fcf6aa 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -137,6 +137,7 @@ function nf_warning(self, level)
, less = "-W1"
, more = "-W3"
, all = "-W3" -- = "-Wall" will enable too more warnings
+ , allextra = "-W4"
, everything = "-Wall"
, error = "-WX"
}
diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua
index 549bdaae1..457de3b60 100644
--- a/xmake/modules/core/tools/clang.lua
+++ b/xmake/modules/core/tools/clang.lua
@@ -118,6 +118,7 @@ function nf_warning(self, level)
, less = "-Wall"
, more = "-Wall"
, all = "-Wall"
+ , allextra = "-Wall -Wextra"
, everything = "-Weverything"
, error = "-Werror"
}
diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua
index 8ee58f23e..4125ab2a0 100644
--- a/xmake/modules/core/tools/clang_cl.lua
+++ b/xmake/modules/core/tools/clang_cl.lua
@@ -33,7 +33,7 @@ function init(self)
["-W1"] = "-Wall"
, ["-W2"] = "-Wall"
, ["-W3"] = "-Wall"
- , ["-W4"] = "-Wextra"
+ , ["-W4"] = "-Wall -Wextra"
, ["-Weverything"] = "-Wall -Wextra -Weffc++"
-- language
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 5ade06550..130790a56 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -112,6 +112,7 @@ function nf_warning(self, level)
, less = "-Wall"
, more = "-Wall"
, all = "-Wall"
+ , allextra = "-Wall -Wextra"
, everything = "-Wall -Wextra -Weffc++"
, error = "-Werror"
}
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index c16643066..958645ec7 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -108,6 +108,7 @@ function nf_warning(self, level)
, less = "-W1"
, more = "-W3"
, all = "-W3" -- = "-Wall" will enable too more warnings
+ , allextra = "-W4"
, everything = "-Wall"
, error = "-WX"
}
@@ -123,6 +124,7 @@ function nf_warning(self, level)
, less = "-Wall"
, more = "-Wall"
, all = "-Wall"
+ , allextra = "-Wall -Wextra"
, everything = "-Weverything -Wall -Wextra -Weffc++"
, error = "-Werror"
}
diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua
index a9c0abfc0..98deebbb7 100644
--- a/xmake/modules/core/tools/tcc.lua
+++ b/xmake/modules/core/tools/tcc.lua
@@ -78,8 +78,8 @@ function nf_warning(self, level)
, less = "-W1"
, more = "-W3"
, all = "-Wall"
- , extra = "-Wunsupported"
- , everything = "-Wall -Wunsupported -Wwrite-strings"
+ , allextra = "-Wall -Wunsupported -Wwrite-strings -Wimplicit-function-declaration"
+ , everything = "-Wall -Wunsupported -Wwrite-strings -Wimplicit-function-declaration"
, error = "-Werror"
}
return maps[level]
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index 8dc3416b0..a90e58d28 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -294,19 +294,21 @@ end
function _add_target_warnings(cmakelists, target)
local flags_gcc =
{
- none = "-w"
- , less = "-Wall"
- , more = "-Wall"
- , all = "-Wall"
- , error = "-Werror"
+ none = "-w"
+ , less = "-Wall"
+ , more = "-Wall"
+ , all = "-Wall"
+ , allextra = "-Wall -Wextra"
+ , error = "-Werror"
}
local flags_msvc =
{
- none = "-W0"
- , less = "-W1"
- , more = "-W3"
- , all = "-W3" -- = "-Wall" will enable too more warnings
- , error = "-WX"
+ none = "-W0"
+ , less = "-W1"
+ , more = "-W3"
+ , all = "-W3" -- = "-Wall" will enable too more warnings
+ , allextra = "-W4"
+ , error = "-WX"
}
local warnings = target:get("warnings")
if warnings then