From 869ee58b82680dae6e0b1d4b37e8c36561b2d2d6 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Wed, 29 May 2019 10:04:34 +0200 Subject: kbuild: Remove -Waggregate-return from scripts/Makefile.extrawarn It makes little sense to pass -Waggregate-return these days since large part of the linux kernel rely on returning struct(s). For instance: ../include/linux/timekeeping.h: In function 'show_uptime': ../include/linux/ktime.h:91:34: error: function call has aggregate value [-Werror=aggregate-return] #define ktime_to_timespec64(kt) ns_to_timespec64((kt)) ^~~~~~~~~~~~~~~~~~~~~~ ../include/linux/timekeeping.h:166:8: note: in expansion of macro 'ktime_to_timespec64' *ts = ktime_to_timespec64(ktime_get_coarse_boottime()); Remove this warning from W=2 completely. Signed-off-by: Mathieu Malaterre Signed-off-by: Masahiro Yamada --- scripts/Makefile.extrawarn | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts/Makefile.extrawarn') diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 3ab8d1a303cd..98081ab300e5 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -34,7 +34,6 @@ warning-1 += $(call cc-option, -Wstringop-truncation) warning-1 += -Wno-missing-field-initializers warning-1 += -Wno-sign-compare -warning-2 := -Waggregate-return warning-2 += -Wcast-align warning-2 += -Wdisabled-optimization warning-2 += -Wnested-externs -- cgit v1.2.3 From 3a61925e91ba9f0ece1b444eb1aa49caa59e4ae7 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Fri, 14 Jun 2019 09:52:42 -0700 Subject: kbuild: Enable -Wuninitialized This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: https://github.com/ClangBuiltLinux/linux/issues/381 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada --- scripts/Makefile.extrawarn | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts/Makefile.extrawarn') diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 98081ab300e5..699683a7c116 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -71,6 +71,5 @@ KBUILD_CFLAGS += -Wno-unused-value KBUILD_CFLAGS += -Wno-format KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-format-zero-length -KBUILD_CFLAGS += -Wno-uninitialized endif endif -- cgit v1.2.3 From 4df607cc6fe8e46b258ff2a53d0a60ca3008ffc7 Mon Sep 17 00:00:00 2001 From: Nathan Huckleberry Date: Mon, 17 Jun 2019 10:28:29 -0700 Subject: kbuild: Remove unnecessary -Wno-unused-value This flag turns off several other warnings that would be useful. Most notably -warn_unused_result is disabled. All of the following warnings are currently disabled: UnusedValue |-UnusedComparison |-warn_unused_comparison |-UnusedResult |-warn_unused_result |-UnevaluatedExpression |-PotentiallyEvaluatedExpression |-warn_side_effects_typeid |-warn_side_effects_unevaluated_context |-warn_unused_expr |-warn_unused_voidptr |-warn_unused_container_subscript_expr |-warn_unused_call With this flag removed there are ~10 warnings. Patches have been submitted for each of these warnings. Reported-by: Nick Desaulniers Cc: clang-built-linux@googlegroups.com Link: https://github.com/ClangBuiltLinux/linux/issues/520 Signed-off-by: Nathan Huckleberry Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada --- scripts/Makefile.extrawarn | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts/Makefile.extrawarn') diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 699683a7c116..a74ce2e3c33e 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -67,7 +67,6 @@ else ifdef CONFIG_CC_IS_CLANG KBUILD_CFLAGS += -Wno-initializer-overrides -KBUILD_CFLAGS += -Wno-unused-value KBUILD_CFLAGS += -Wno-format KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-format-zero-length -- cgit v1.2.3