lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202202101548.D2CF8DAC@keescook>
Date:   Thu, 10 Feb 2022 15:48:44 -0800
From:   Kees Cook <keescook@...omium.org>
To:     Victor Erminpour <victor.erminpour@...cle.com>
Cc:     a.zummo@...ertech.it, alexandre.belloni@...tlin.com,
        linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
        trivial@...nel.org
Subject: Re: [PATCH] rtc: pcf8523: Fix GCC 12 warning

On Wed, Feb 09, 2022 at 04:30:27PM -0800, Victor Erminpour wrote:
> When building with automatic stack variable initialization, GCC 12
> complains about variables defined outside of switch case statements.
> Move variables outside the switch, which silences warnings:
> 
> ./drivers/rtc/rtc-pcf8523.c:284:20: error: statement will never be executed [-Werror=switch-unreachable]
>   284 |                 u8 mode;
>       |
> 
> ./drivers/rtc/rtc-pcf8523.c:245:21: error: statement will never be executed [-Werror=switch-unreachable]
>   245 |                 u32 value;
>       |                     ^~~~~
> 
> Signed-off-by: Victor Erminpour <victor.erminpour@...cle.com>

Thanks for finding these! I haven't done any cross compiles with GCC 12
yet. :)

Reviewed-by: Kees Cook <keescook@...omium.org>

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ