btrfs: handle -Wmaybe-uninitialized with clang
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.
--- fs/btrfs/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/Makefile +2 -2
@@ -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
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")Signed-off-by Tom Rix <[email protected]>
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@@ -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-initializersSignature · 1 line
2.27.0
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")Signed-off-by Tom Rix <[email protected]>
Folded to the patch, thanks.