public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings
@ 2023-07-05 14:01 Arnd Bergmann
  2023-07-05 14:01 ` [PATCH 2/2] btrfs: fix 64-bit division link failure Arnd Bergmann
  2023-07-10 16:55 ` [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2023-07-05 14:01 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Arnd Bergmann, Johannes Thumshirn, Anand Jain, Filipe Manana,
	Qu Wenruo, linux-btrfs, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The -Wmaybe-uninitialized warning option in gcc produces tons of false
positive warnings when KASAN is enabled, as that turns off some required
optimizations.

Rework the makefile to only enable the warning in btrfs when KASAN is
disabled, as it was before commit 78a5255ffb6a1 ("Stop the ad-hoc games
with -Wno-maybe-initialized") turned it off globally.

Fixes: 1ec49744ba83f ("btrfs: turn on -Wmaybe-uninitialized")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/btrfs/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 90d53209755bf..a4927bf2ce7ee 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -11,8 +11,12 @@ condflags := \
 	$(call cc-option, -Wunused-but-set-variable)		\
 	$(call cc-option, -Wunused-const-variable)		\
 	$(call cc-option, -Wpacked-not-aligned)			\
-	$(call cc-option, -Wstringop-truncation)		\
-	$(call cc-option, -Wmaybe-uninitialized)
+	$(call cc-option, -Wstringop-truncation)
+
+ifndef CONFIG_KASAN
+conflags += $(call cc-option, -Wmaybe-uninitialized)
+endif
+
 subdir-ccflags-y += $(condflags)
 # The following turn off the warnings enabled by -Wextra
 subdir-ccflags-y += -Wno-missing-field-initializers
-- 
2.39.2


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

end of thread, other threads:[~2023-07-10 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 14:01 [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings Arnd Bergmann
2023-07-05 14:01 ` [PATCH 2/2] btrfs: fix 64-bit division link failure Arnd Bergmann
2023-07-10 17:06   ` David Sterba
2023-07-10 16:55 ` [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings David Sterba
2023-07-10 19:12   ` Arnd Bergmann
2023-07-10 19:25     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox