Skip to contentSkip to conversation

kbuild: Remove unnecessary -Wno-unused-value

PATCH In review Nathan Huckleberry 3 participants 3 messages Jun 17, 2019 – Jun 20, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)
scripts/Makefile.extrawarn +0 -1
index 3ab8d1a303cd..b293246e48fe 100644
@@ -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
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Nathan Huckleberry

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
Quoted 7 lines

With this flag removed there are ~10 warnings. Patches have been submitted for each of these warnings.

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.

Quoted 19 lines
---
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)
scripts/Makefile.extrawarn +0 -2
index 3ab8d1a303cd..b293246e48fe 100644
@@ -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

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
In reply to Nathan Huckleberry
Quoted 19 lines · Nathan Huckleberry

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
Quoted 8 lines

With this flag removed there are ~10 warnings. Patches have been submitted for each of these warnings.

---

Applied to linux-kbuild.
Thanks!

Quoted 18 lines
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)
scripts/Makefile.extrawarn +0 -2
index 3ab8d1a303cd..b293246e48fe 100644
@@ -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

Signature · 2 lines
Best Regards
Masahiro Yamada