Skip to contentSkip to conversation

btrfs: handle -Wmaybe-uninitialized with clang

PATCH In review Tom Rix 3 participants 3 messages Dec 30, 2022 – Jan 2, 2023 Btrfs file system

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 btrfs: handle -Wmaybe-uninitialized with clang

The clang build reports this error
error: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Werror,-Wunknown-warning-option] make[3]: *** [scripts/Makefile.build:252: fs/btrfs/super.o] Error 1

-Wmaybe-uninitialized is a gcc only flag. Move to setting with cc-option.

Fixes 1b19c4c249a1 ("btrfs: turn on -Wmaybe-uninitialized")
---
 fs/btrfs/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/Makefile +2 -2
index eca995abccdf..460eced3f5bd 100644
@@ -7,12 +7,12 @@ subdir-ccflags-y += -Wmissing-format-attribute
 subdir-ccflags-y += -Wmissing-prototypes
 subdir-ccflags-y += -Wold-style-definition
 subdir-ccflags-y += -Wmissing-include-dirs
-subdir-ccflags-y += -Wmaybe-uninitialized
 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, -Wstringop-truncation)		\
+	$(call cc-option, -Wmaybe-uninitialized)
 subdir-ccflags-y += $(condflags)
 # The following turn off the warnings enabled by -Wextra
 subdir-ccflags-y += -Wno-missing-field-initializers
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Tom Rix

The clang build reports this error
error: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Werror,-Wunknown-warning-option] make[3]: *** [scripts/Makefile.build:252: fs/btrfs/super.o] Error 1

-Wmaybe-uninitialized is a gcc only flag. Move to setting with cc-option.

Fixes 1b19c4c249a1 ("btrfs: turn on -Wmaybe-uninitialized")

Thanks for the patch! Looks like I forgot to double back to this...

https://lore.kernel.org/[email protected]/

Quoted 26 lines
---
 fs/btrfs/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/Makefile +2 -2
index eca995abccdf..460eced3f5bd 100644
@@ -7,12 +7,12 @@ subdir-ccflags-y += -Wmissing-format-attribute
 subdir-ccflags-y += -Wmissing-prototypes
 subdir-ccflags-y += -Wold-style-definition
 subdir-ccflags-y += -Wmissing-include-dirs
-subdir-ccflags-y += -Wmaybe-uninitialized
 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, -Wstringop-truncation)		\
+	$(call cc-option, -Wmaybe-uninitialized)
 subdir-ccflags-y += $(condflags)
 # The following turn off the warnings enabled by -Wextra
 subdir-ccflags-y += -Wno-missing-field-initializers
Signature · 1 line
2.27.0
#2 lore raw
In reply to Tom Rix
Quoted 8 lines · Tom Rix

The clang build reports this error
error: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Werror,-Wunknown-warning-option] make[3]: *** [scripts/Makefile.build:252: fs/btrfs/super.o] Error 1

-Wmaybe-uninitialized is a gcc only flag. Move to setting with cc-option.

Fixes 1b19c4c249a1 ("btrfs: turn on -Wmaybe-uninitialized")

Folded to the patch, thanks.