Subject: Re: [GIT PULL] Second batch of KVM changes for Linux 5.6-rc4 (or rc5)

From: Segher Boessenkool <[email-masked]>
Date: Mon, 2 Mar 2020 06:14:55 -0600

On Mon, Mar 02, 2020 at 09:51:44PM +1100, Michael Ellerman wrote:
> Linus Torvalds <[email-masked]> writes:
> > Michael, what tends to be the triggers for people using
> > PPC_DISABLE_WERROR? Do you have reports for it?
> 
> My memory is that we have had very few reports of it actually causing
> problems. But I don't have hard data to back that up.

I build all archs with GCC trunk.

It always breaks for me, with thousands of errors, which is why since
many years I carry 21 lines of patch to thoroughly disable -Werror for
the powerpc arch.  It takes over a year from when a warning is added to
the kernel taking care of it -- and of course, I build with the current
development version of the compiler, so I get to see many misfiring
warnings and other fallout as well.  (Currently there are more than 100
warnings, this is way too many to consider attacking that as well).

> It has tripped up the Clang folks, but that's partly because they're
> building clang HEAD, and also because ~zero powerpc kernel developers
> are building regularly with clang. I'm trying to fix the latter ...

Is anyone building regularly with GCC HEAD?  Power or any other arch?

> And then building with GCC head sometimes requires disabling -Werror
> because of some new warning, sometimes valid sometimes not.

Yes.  And never worth breaking the build for.

-Werror is something you use if you do not trust your developers.

Warnings are not errors.  The compiler warns for things that
heuristically look suspicious.  And it errors for things that are wrong.

Some warnings have many false positives, but are so useful (find many
nasty problems, for example) that it is worth enabling them often.
-Werror sabotages that, giving people an extra incentive to disable
useful warnings.

> I think we could mostly avoid those problems by having the option only
> on by default for known compiler versions.

Well, the kernel disables most useful warnings anyway, so that might
even work, sure.

> It'd also be nice if we could do:
> 
>  $ make WERROR=0
> 
> Or something similarly obvious to turn off the WERROR option. That way
> users don't even have to edit their .config manually, they just rerun
> make with WERROR=0 and it works.

That would be nice, yes, that would help my situation as well.

Segher