Files
linux/kernel
Linus Torvalds ce9f411be7 Stop the ad-hoc games with -Wno-maybe-initialized
commit 78a5255ffb upstream.

We have some rather random rules about when we accept the
"maybe-initialized" warnings, and when we don't.

For example, we consider it unreliable for gcc versions < 4.9, but also
if -O3 is enabled, or if optimizing for size.  And then various kernel
config options disabled it, because they know that they trigger that
warning by confusing gcc sufficiently (ie PROFILE_ALL_BRANCHES).

And now gcc-10 seems to be introducing a lot of those warnings too, so
it falls under the same heading as 4.9 did.

At the same time, we have a very straightforward way to _enable_ that
warning when wanted: use "W=2" to enable more warnings.

So stop playing these ad-hoc games, and just disable that warning by
default, with the known and straight-forward "if you want to work on the
extra compiler warnings, use W=123".

Would it be great to have code that is always so obvious that it never
confuses the compiler whether a variable is used initialized or not?
Yes, it would.  In a perfect world, the compilers would be smarter, and
our source code would be simpler.

That's currently not the world we live in, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:15:37 +02:00
..
2016-01-22 18:04:28 -05:00
2016-04-04 09:46:47 -04:00
2019-11-28 18:28:55 +01:00
2015-04-12 21:03:31 +02:00
2020-04-02 17:20:28 +02:00
2015-11-23 09:44:58 +01:00
2018-08-03 07:55:12 +02:00
2020-04-02 17:20:26 +02:00
2016-02-16 13:04:58 -05:00
2015-01-17 10:02:23 +13:00
2020-04-24 07:58:54 +02:00
2016-03-01 20:36:56 +01:00
2018-08-03 07:55:24 +02:00
2020-01-12 11:24:12 +01:00
2018-05-09 09:50:20 +02:00
2016-09-22 20:00:36 -05:00