* [PATCH] bcachefs: Add statement to switch in check_bch_counter_ids_unique()
@ 2025-08-12 18:02 Nathan Chancellor
2025-08-12 18:14 ` Kent Overstreet
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-08-12 18:02 UTC (permalink / raw)
To: Kent Overstreet
Cc: Francis Rossi, linux-bcachefs, llvm, patches, Nathan Chancellor
Clang warns (or errors with CONFIG_WERROR=y):
fs/bcachefs/sb-counters_format.h:132:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
132 | }
| ^
In older versions of clang, this is an unconditional hard error:
fs/bcachefs/sb-counters_format.h:130:34: error: label at end of compound statement: expected statement
BCH_PERSISTENT_COUNTERS()
^
;
Add an empty statement to resolve the error/warning.
Fixes: 38de86383436 ("bcachefs: Switch statement evaluate ids and confirm they are unique going forward")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
fs/bcachefs/sb-counters_format.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/bcachefs/sb-counters_format.h b/fs/bcachefs/sb-counters_format.h
index bfeb713dd210..96ad64920810 100644
--- a/fs/bcachefs/sb-counters_format.h
+++ b/fs/bcachefs/sb-counters_format.h
@@ -129,6 +129,7 @@ static inline void __maybe_unused check_bch_counter_ids_unique(void) {
#define x(t, n, ...) case (n):
BCH_PERSISTENT_COUNTERS()
#undef x
+ ;
}
}
---
base-commit: 65c604dba89a86d3dae0bd98b7b0b6c077ac930c
change-id: 20250812-bcachefs-fix-switch-check_bch_counter_ids_unique-2888b136b877
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bcachefs: Add statement to switch in check_bch_counter_ids_unique()
2025-08-12 18:02 [PATCH] bcachefs: Add statement to switch in check_bch_counter_ids_unique() Nathan Chancellor
@ 2025-08-12 18:14 ` Kent Overstreet
0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2025-08-12 18:14 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: Francis Rossi, linux-bcachefs, llvm, patches
On Tue, Aug 12, 2025 at 11:02:11AM -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
>
> fs/bcachefs/sb-counters_format.h:132:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
> 132 | }
> | ^
>
> In older versions of clang, this is an unconditional hard error:
>
> fs/bcachefs/sb-counters_format.h:130:34: error: label at end of compound statement: expected statement
> BCH_PERSISTENT_COUNTERS()
> ^
> ;
>
> Add an empty statement to resolve the error/warning.
>
> Fixes: 38de86383436 ("bcachefs: Switch statement evaluate ids and confirm they are unique going forward")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thanks, applied.
> ---
> fs/bcachefs/sb-counters_format.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/bcachefs/sb-counters_format.h b/fs/bcachefs/sb-counters_format.h
> index bfeb713dd210..96ad64920810 100644
> --- a/fs/bcachefs/sb-counters_format.h
> +++ b/fs/bcachefs/sb-counters_format.h
> @@ -129,6 +129,7 @@ static inline void __maybe_unused check_bch_counter_ids_unique(void) {
> #define x(t, n, ...) case (n):
> BCH_PERSISTENT_COUNTERS()
> #undef x
> + ;
> }
> }
>
>
> ---
> base-commit: 65c604dba89a86d3dae0bd98b7b0b6c077ac930c
> change-id: 20250812-bcachefs-fix-switch-check_bch_counter_ids_unique-2888b136b877
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-12 18:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 18:02 [PATCH] bcachefs: Add statement to switch in check_bch_counter_ids_unique() Nathan Chancellor
2025-08-12 18:14 ` Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).