Re: [PATCH] perf annotate: Fix Clang build by adding block in switch case
From: Namhyung Kim
Date: Fri Oct 24 2025 - 14:57:40 EST
On Wed, 22 Oct 2025 12:02:40 +0100, James Clark wrote:
> Clang and GCC disagree with what constitutes a "declaration after
> statement". GCC allows declarations in switch cases without an extra
> block, as long as it's immediately after the label. Clang does not.
> Unfortunately this is the case even in the latest versions of both
> compilers. The only option that makes them behave in the same way is
> -Wpedantic, which can't be enabled in Perf because of the number of
> warnings it generates.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung