* [PATCH] btrfs: handle -Wmaybe-uninitialized with clang
@ 2022-12-30 17:55 Tom Rix
2022-12-30 18:02 ` Nathan Chancellor
2023-01-02 12:05 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Tom Rix @ 2022-12-30 17:55 UTC (permalink / raw)
To: clm, josef, dsterba, nathan, ndesaulniers, wqu
Cc: linux-btrfs, linux-kernel, llvm, 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 <trix@redhat.com>
---
fs/btrfs/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index eca995abccdf..460eced3f5bd 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -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
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: handle -Wmaybe-uninitialized with clang
2022-12-30 17:55 [PATCH] btrfs: handle -Wmaybe-uninitialized with clang Tom Rix
@ 2022-12-30 18:02 ` Nathan Chancellor
2023-01-02 12:05 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-12-30 18:02 UTC (permalink / raw)
To: Tom Rix
Cc: clm, josef, dsterba, ndesaulniers, wqu, linux-btrfs, linux-kernel, llvm
On Fri, Dec 30, 2022 at 12:55:07PM -0500, Tom Rix wrote:
> 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 <trix@redhat.com>
Thanks for the patch! Looks like I forgot to double back to this...
https://lore.kernel.org/Y6kgR4qnb23UdAEX@dev-arch.thelio-3990X/
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> fs/btrfs/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
> index eca995abccdf..460eced3f5bd 100644
> --- a/fs/btrfs/Makefile
> +++ b/fs/btrfs/Makefile
> @@ -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
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: handle -Wmaybe-uninitialized with clang
2022-12-30 17:55 [PATCH] btrfs: handle -Wmaybe-uninitialized with clang Tom Rix
2022-12-30 18:02 ` Nathan Chancellor
@ 2023-01-02 12:05 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2023-01-02 12:05 UTC (permalink / raw)
To: Tom Rix
Cc: clm, josef, dsterba, nathan, ndesaulniers, wqu, linux-btrfs,
linux-kernel, llvm
On Fri, Dec 30, 2022 at 12:55:07PM -0500, Tom Rix wrote:
> 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 <trix@redhat.com>
Folded to the patch, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-02 12:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-30 17:55 [PATCH] btrfs: handle -Wmaybe-uninitialized with clang Tom Rix
2022-12-30 18:02 ` Nathan Chancellor
2023-01-02 12:05 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.