Turn off -Wmaybe-uninitialized when building with -Os
authorArnd Bergmann <arnd@arndb.de>
Fri, 15 Feb 2013 20:23:58 +0000 (21:23 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 19 Mar 2018 18:58:21 +0000 (18:58 +0000)
commit386970a360dfc72b052802cdb3a74625b252919f
treea3ed44accf74aee47ec0df9b8d4982e2a2588737
parenta2d4436a69c3570419680ee75b431d2d9af26254
Turn off -Wmaybe-uninitialized when building with -Os

commit e74fc973b6e531fef1fce8b101ffff05ecfb774c upstream.

gcc-4.7 and higher add a lot of false positive warnings about
potential uses of uninitialized warnings, but only when optimizing
for size (-Os). This is the default when building allyesconfig,
which turns on CONFIG_CC_OPTIMIZE_FOR_SIZE.

In order to avoid getting a lot of patches that initialize such
variables and accidentally hide real errors along the way, let's
just turn off this warning on the respective gcc versions
when building with size optimizations. The -Wmaybe-uninitialized
option was introduced in the same gcc version (4.7) that is now
causing the false positives, so there is no effect on older compilers.

A side effect is that when building with CONFIG_CC_OPTIMIZE_FOR_SIZE,
we might now see /fewer/ warnings about possibly uninitialized
warnings than with -O2, but that is still much better than seeing
warnings known to be bogus.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Makefile