Re: [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings

From: David Sterba
Date: Mon Jul 10 2023 - 13:01:49 EST


On Wed, Jul 05, 2023 at 04:01:08PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The -Wmaybe-uninitialized warning option in gcc produces tons of false
> positive warnings when KASAN is enabled, as that turns off some required
> optimizations.

Which version of gcc produces the warnings? I have KASAN enabled and
don't see any warnings, with gcc 13. Making the warning conditional
would effectively turn it off for me which means I can't catch the
warnings early. We do get reports from various build bots with
various arch/compiler combinations and fix the warnings.

If there's a know minimum compiler version where there are no reports
(or reasonably small nubmer to fix) then I'd rather make the condition
bassed on that, neither on KASAN nor any similar feature for that matter.