[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a6kgerdk.fsf@oldenburg.str.redhat.com>
Date: Mon, 13 Sep 2021 11:50:31 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Pavel Machek <pavel@....cz>
Cc: Randy Dunlap <rdunlap@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Marco Elver <elver@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
llvm@...ts.linux.dev,
LSM List <linux-security-module@...r.kernel.org>,
linux-toolchains@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Kees Cook <keescook@...omium.org>,
Mark Brown <broonie@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Vipin Sharma <vipinsh@...gle.com>,
Chris Down <chris@...isdown.name>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Daniel Borkmann <daniel@...earbox.net>,
Vlastimil Babka <vbabka@...e.cz>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Revert "Enable '-Werror' by default for all kernel builds"
* Pavel Machek:
> Do we really want developers treat warnings as errors? When the code
> is okay but some random version of gcc dislikes it...
There are some warnings-as-errors which are quite reasonable, like
-Werror=implicit-function-declaration (which we can't make the compiler
default without cleaning up userspace first) and perhaps
-Werror=implicit-int. Some other warnings can be used to enforce coding
style, and there -Werror could make sense as well (-Werror=vla and
others).
But there are also warnings which are emitted by the GCC middle-end (the
optimizers), and turning on -Werror for those is very problematic.
These warnings are very target-specific and also depend on compiler
version and optimization parameters. Unfortunately that includes the
buffer size warnings based on function attributes (which would otherwise
be a good fit for the kernel because it uses few external headers).
GCC also lacks a facility to suppress warnings if they concern code that
was introduced during optimization and removed again later
(e.g. inlining, constant propagation, dead code removal).
Thanks,
Florian
Powered by blists - more mailing lists