linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Remove unnecessary -Wno-unused-value
@ 2019-06-17 17:28 Nathan Huckleberry
  2019-06-17 17:48 ` Nick Desaulniers
  2019-06-20 15:52 ` Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Huckleberry @ 2019-06-17 17:28 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml
  Cc: linux-kbuild, linux-kernel, Nathan Huckleberry, Nick Desaulniers,
	clang-built-linux

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 <ndesaulniers@google.com>
Cc: clang-built-linux@googlegroups.com
Link: https://github.com/ClangBuiltLinux/linux/issues/520
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
---
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 3ab8d1a303cd..b293246e48fe 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -68,7 +68,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
-- 
2.22.0.410.gd8fdbe21b5-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: Remove unnecessary -Wno-unused-value
  2019-06-17 17:28 [PATCH] kbuild: Remove unnecessary -Wno-unused-value Nathan Huckleberry
@ 2019-06-17 17:48 ` Nick Desaulniers
  2019-06-20 15:52 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2019-06-17 17:48 UTC (permalink / raw)
  To: Nathan Huckleberry
  Cc: Masahiro Yamada, Michal Marek, Linux Kbuild mailing list, LKML,
	clang-built-linux

On Mon, Jun 17, 2019 at 10:28 AM Nathan Huckleberry <nhuck@google.com> wrote:
>
> 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 <ndesaulniers@google.com>
> Cc: clang-built-linux@googlegroups.com
> Link: https://github.com/ClangBuiltLinux/linux/issues/520
> Signed-off-by: Nathan Huckleberry <nhuck@google.com>

Most importantly, it fixes __must_check, which has been silently not
working w/ Clang.  Nathan sent patches for the issues we could find w/
x86_65 and arm64 allyesconfig builds, and even fixed a bug in Clang.
https://reviews.llvm.org/D63369

Thanks for all of the work that went into this.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  scripts/Makefile.extrawarn | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 3ab8d1a303cd..b293246e48fe 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -68,7 +68,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
> --
> 2.22.0.410.gd8fdbe21b5-goog
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: Remove unnecessary -Wno-unused-value
  2019-06-17 17:28 [PATCH] kbuild: Remove unnecessary -Wno-unused-value Nathan Huckleberry
  2019-06-17 17:48 ` Nick Desaulniers
@ 2019-06-20 15:52 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-06-20 15:52 UTC (permalink / raw)
  To: Nathan Huckleberry
  Cc: Michal Marek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Nick Desaulniers, clang-built-linux

On Tue, Jun 18, 2019 at 2:28 AM Nathan Huckleberry <nhuck@google.com> wrote:
>
> 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 <ndesaulniers@google.com>
> Cc: clang-built-linux@googlegroups.com
> Link: https://github.com/ClangBuiltLinux/linux/issues/520
> Signed-off-by: Nathan Huckleberry <nhuck@google.com>
> ---

Applied to linux-kbuild.
Thanks!


>  scripts/Makefile.extrawarn | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 3ab8d1a303cd..b293246e48fe 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -68,7 +68,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
> --
> 2.22.0.410.gd8fdbe21b5-goog
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-20 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 17:28 [PATCH] kbuild: Remove unnecessary -Wno-unused-value Nathan Huckleberry
2019-06-17 17:48 ` Nick Desaulniers
2019-06-20 15:52 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).