* -Werror for `make W=0` @ 2020-08-19 9:44 Andy Shevchenko 2020-08-19 10:45 ` Masahiro Yamada 2020-08-19 18:29 ` Linus Torvalds 0 siblings, 2 replies; 5+ messages in thread From: Andy Shevchenko @ 2020-08-19 9:44 UTC (permalink / raw) To: linux-kernel Cc: Arvind Sankar, Ard Biesheuvel, Dmitry Vyukov, Masahiro Yamada, x86, David Laight, Linus Torvalds, Nick Desaulniers Hi! Maybe silly idea, but would it make sense to enable -Werror for default warning level, let's say W=0, at some point? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -Werror for `make W=0` 2020-08-19 9:44 -Werror for `make W=0` Andy Shevchenko @ 2020-08-19 10:45 ` Masahiro Yamada 2020-08-19 11:50 ` Andy Shevchenko 2020-08-19 18:29 ` Linus Torvalds 1 sibling, 1 reply; 5+ messages in thread From: Masahiro Yamada @ 2020-08-19 10:45 UTC (permalink / raw) To: Andy Shevchenko Cc: Linux Kernel Mailing List, Arvind Sankar, Ard Biesheuvel, Dmitry Vyukov, X86 ML, David Laight, Linus Torvalds, Nick Desaulniers On Wed, Aug 19, 2020 at 6:44 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > Hi! > > Maybe silly idea, but would it make sense to enable -Werror for default warning > level, let's say W=0, at some point? > Every GCC release adds new warning options. Enabling -Werror by default means the kernel build is suddenly broken with new compilers, correct? -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -Werror for `make W=0` 2020-08-19 10:45 ` Masahiro Yamada @ 2020-08-19 11:50 ` Andy Shevchenko 2020-08-19 16:55 ` Nick Desaulniers 0 siblings, 1 reply; 5+ messages in thread From: Andy Shevchenko @ 2020-08-19 11:50 UTC (permalink / raw) To: Masahiro Yamada Cc: Andy Shevchenko, Linux Kernel Mailing List, Arvind Sankar, Ard Biesheuvel, Dmitry Vyukov, X86 ML, David Laight, Linus Torvalds, Nick Desaulniers On Wed, Aug 19, 2020 at 1:48 PM Masahiro Yamada <masahiroy@kernel.org> wrote: > On Wed, Aug 19, 2020 at 6:44 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > > > Hi! > > > > Maybe silly idea, but would it make sense to enable -Werror for default warning > > level, let's say W=0, at some point? > > > > Every GCC release adds new warning options. > > Enabling -Werror by default means > the kernel build is suddenly broken > with new compilers, correct? Probably, and at the same time we keep our hand on the pulse of the changes, right? Adding those warnings to W=1, 2, ... block might be not the bad idea after all. Maybe some flag CONFIG_DEBUG_WERROR ? Then CIs or other early stage users can enable by default and be informed. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -Werror for `make W=0` 2020-08-19 11:50 ` Andy Shevchenko @ 2020-08-19 16:55 ` Nick Desaulniers 0 siblings, 0 replies; 5+ messages in thread From: Nick Desaulniers @ 2020-08-19 16:55 UTC (permalink / raw) To: Andy Shevchenko Cc: Masahiro Yamada, Andy Shevchenko, Linux Kernel Mailing List, Arvind Sankar, Ard Biesheuvel, Dmitry Vyukov, X86 ML, David Laight, Linus Torvalds On Wed, Aug 19, 2020 at 4:50 AM Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > > On Wed, Aug 19, 2020 at 1:48 PM Masahiro Yamada <masahiroy@kernel.org> wrote: > > On Wed, Aug 19, 2020 at 6:44 PM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > > Hi! > > > > > > Maybe silly idea, but would it make sense to enable -Werror for default warning > > > level, let's say W=0, at some point? > > > > > > > Every GCC release adds new warning options. > > > > Enabling -Werror by default means > > the kernel build is suddenly broken > > with new compilers, correct? > > Probably, and at the same time we keep our hand on the pulse of the > changes, right? > Adding those warnings to W=1, 2, ... block might be not the bad idea after all. > > Maybe some flag CONFIG_DEBUG_WERROR ? Then CIs or other early stage > users can enable by default and be informed. Google's pixel kernel team carries an out of tree patch creating exactly such a config. It helps them keep their kernels building warning free. Flip side is that if a build isn't warning free, it can be difficult to get there; you need to at least disable the config to see how many warnings you have, and identify which are lower hanging fruit. It also makes compiler upgrades excessively difficult. In my experience on Android, if folks are too busy to address compiler warnings, then new warnings added by a new compiler version just get turned off and never addressed. My experience with the kernel has been that fixes for different warnings also take varying amounts of time to get accepted and work their way through mainline, meanwhile builds are broken. I agree that it's ideal to have no warnings, but from my perspective -Werror is a major impediment to upgrading the tools. Wouldn't recommend. -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -Werror for `make W=0` 2020-08-19 9:44 -Werror for `make W=0` Andy Shevchenko 2020-08-19 10:45 ` Masahiro Yamada @ 2020-08-19 18:29 ` Linus Torvalds 1 sibling, 0 replies; 5+ messages in thread From: Linus Torvalds @ 2020-08-19 18:29 UTC (permalink / raw) To: Andy Shevchenko Cc: Linux Kernel Mailing List, Arvind Sankar, Ard Biesheuvel, Dmitry Vyukov, Masahiro Yamada, the arch/x86 maintainers, David Laight, Nick Desaulniers On Wed, Aug 19, 2020 at 2:44 AM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > Maybe silly idea, but would it make sense to enable -Werror for default warning > level, let's say W=0, at some point? I'd love to, and would have done that a long time ago, but we just haven't been able to depend on the compilers not having random warnings in random versions. And making it a config option doesn't work well either, simply because that will just mean that bots will randomly fail if they set that option, and if we make it harder to set developers won't have it set anyway, and it doesn't help much. End result: using -Werror works wonderfully in controlled environments. Not so wonderfully in the general random mess. That said, I've been so aggressive against accepting new warnings that I've considered this unconditionally anyway, and then dealing with compiler version fallout by just disabling certain compilers and/or certain options. But it would almost certainly be pretty painful. Linus ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-19 18:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-19 9:44 -Werror for `make W=0` Andy Shevchenko 2020-08-19 10:45 ` Masahiro Yamada 2020-08-19 11:50 ` Andy Shevchenko 2020-08-19 16:55 ` Nick Desaulniers 2020-08-19 18:29 ` Linus Torvalds
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®