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: <CAK8P3a2V+AYbXZC6zG6iJzOM3HugcB3Odx74jzVzSK4mfQ1Ftw@mail.gmail.com>
Date:   Thu, 21 Feb 2019 10:21:20 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nathan Chancellor <natechancellor@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] kbuild: compute false-positive -Wmaybe-uninitialized
 cases in Kconfig

On Thu, Feb 21, 2019 at 5:14 AM Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
>
> Since -Wmaybe-uninitialized was introduced by GCC 4.7, we have patched
> various false positives:
>
>  - commit e74fc973b6e5 ("Turn off -Wmaybe-uninitialized when building
>    with -Os") turned off this option for -Os.
>
>  - commit 815eb71e7149 ("Kbuild: disable 'maybe-uninitialized' warning
>    for CONFIG_PROFILE_ALL_BRANCHES") turned off this option for
>    CONFIG_PROFILE_ALL_BRANCHES
>
>  - commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
>    for "make W=1"") turned off this option for GCC < 4.9
>    Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903
>
> I think this looks better by shifting the logic from Makefile to Kconfig.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>

I like how this cleans up the logic and documents it better.
I've had my own plans to move this (and most other conditional warning
options) into a header file using the KBUILD_WARN() infrastructure, but
never got around to doing that. I still think that's what we want eventually,
but in the meantime your patch seems fine as well.

Also, I see that your patch keeps the existing logic, which is good,
but we may want to refine this a little afterwards:

- we may want to turn off -Wuninitialized for gcc-4.6 and gcc-4.7
  instead of turning off -Wmaybe-uninitialized as we do in the later
  compilers.

- the proposed CC_OPTIMIZE_FOR_DEBUGGING may need the
  same workaround as CC_OPTIMZE_FOR_SIZE.

- For clang, we may want to /not/ turn off -Wmaybe-uninitialized
  in all cases. I haven't tried build with with 'clang -Oz
  -Wmaybe-uninitialized', but if the number of false positives is small
  enough, we could decide to just leave that on.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ