[PATCH] selftests/powerpc: Avoid GCC 12 uninitialised variable warning

Michael Ellerman patch-notifications at ellerman.id.au
Tue Aug 2 21:03:45 AEST 2022


On Mon, 1 Aug 2022 21:37:46 +1000, Michael Ellerman wrote:
> GCC 12 thinks that `actual` might be used uninitialised. It's not, the
> use is guarded by `bad_mmcr2` which is only set to true at the same
> point where `actual` is initialised.
> 
>   cycles_with_mmcr2_test.c: In function ‘cycles_with_mmcr2’:
>   cycles_with_mmcr2_test.c:81:17: error: ‘actual’ may be used uninitialized [-Werror=maybe-uninitialized]
>      81 |                 printf("Bad MMCR2 value seen is 0x%lx\n", actual);
> 
> [...]

Applied to powerpc/next.

[1/1] selftests/powerpc: Avoid GCC 12 uninitialised variable warning
      https://git.kernel.org/powerpc/c/ff446cd76854d47f451a84c26bb70934ae2ec5a7

cheers


More information about the Linuxppc-dev mailing list