mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Michal Marek <mmarek@suse.com>
Cc: linux-kbuild@vger.kernel.org, fengguang.wu@intel.com,
	kbuild-all@01.org, Arnd Bergmann <arnd@arndb.de>,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
Date: Fri, 13 Jan 2017 16:40:01 +0100	[thread overview]
Message-ID: <20170113154010.2718601-1-arnd@arndb.de> (raw)
In-Reply-To: <201701131834.BsUjtXaC%fengguang.wu@intel.com>

In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
for "make W=1""), I reverted another change that happened to fix a problem
with old compilers, and now we get this report again with old compilers
(prior to gcc-4.8) and GCOV enabled:

   cc1: warnings being treated as errors
   drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
   drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
   At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"

The problem is that we turn off the warning conditionally in a number
of places as we should, but one of them does it unconditionally.
Instead, change it to call cc-disable-warning as we do elsewhere.

The original patch that caused it was merged into linux-4.7, then
4.8 removed the change and 4.9 brought it back, so we probably want
a backport to 4.9 once this is merged.

Cc: stable@vger.kernel.org
Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4fcc0f2dd93c..dbe9ce5d0e96 100644
--- a/Makefile
+++ b/Makefile
@@ -370,7 +370,7 @@ LDFLAGS_MODULE  =
 CFLAGS_KERNEL	=
 AFLAGS_KERNEL	=
 LDFLAGS_vmlinux =
-CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
+CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
 CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)
 
 
-- 
2.9.0

  reply	other threads:[~2017-01-13 15:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 10:40 cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" kbuild test robot
2017-01-13 15:40 ` Arnd Bergmann [this message]
2017-01-27 16:03   ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Arnd Bergmann
2017-03-14 16:17   ` Masahiro Yamada
2017-03-14 20:52     ` Arnd Bergmann
2017-03-16 14:23       ` Arnd Bergmann
2017-03-16 14:31         ` [PATCH] kbuild: fix compile time regression Arnd Bergmann
2017-03-16 17:41           ` Masahiro Yamada
2017-03-16 17:38         ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Masahiro Yamada
2017-03-16 17:35       ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170113154010.2718601-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®