public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: linux-kbuild@vger.kernel.org,
	Brian Norris <computersforpeace@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Overriding -Werror
Date: Thu, 14 Aug 2014 15:21:19 -0700	[thread overview]
Message-ID: <20140814222119.GD18411@ld-irv-0074> (raw)

Hi all,

I'm interested in being able to build-test kernels on various
architectures while enabling extra warnings (make W=[123]). I'd like to
be able to finish the builds and see all warnings, rather than seeing a
failed build. However, GCC's -Werror is incompatible with this. There is
plenty of code that will produce at least one warning, when warning
verbosity is turned up. And GCC's -Werror is not guaranteed to remain
stable over time; new versions may develop new warnings that may or may
not be legitimate.

It seems that there are a few problem ARCHes that enable -Werror by
default: SuperH (orphaned), SPARC, and MIPS. There are also a few
scattered Makefiles throughout the build tree. Developers have
previously tried to remove some of the worst offenders [1], but were
mostly rejected [2]. It doesn't seem like we can fully prevent
maintainers from enabling -Werror on their code--or even on their entire
ARCH build, as with MIPS--for better or worse, so I look to other
alternatives.

For the easiest approach, I considered how one might add -Wno-error to
the CFLAGS. 'make KCFLAGS=-Wno-error' looked promising, but
KBUILD_CFLAGS is applied before the sub-directory Makefiles add their
own options to ccflags-y. So it seems like others have come to the same
conclusion as me: that Kbuild doesn't seem to provide a way to override
the -Werror behvaior from the top level. [3][4]

So, how can we fix this? -Werror may be useful in some cases to
encourage developers to fix up their code immediately, but it is
decidedly unhelpful when running code through analysis tools.

Possibilities include:

1. make -Werror be applied only when we do not have W=[123]. [5]

2. develop a top-level override for CFLAGS that is applied *after* all
   sub-directory modifications

3. make -Werror opt-in / configurable, like PPC's CONFIG_PPC_WERROR
   (maybe make it a generic CONFIG_WERROR?), and prevent its
   unconditional use in Makefiles

4. better ideas?

Regards,
Brian

[1] http://www.linux-mips.org/archives/linux-mips/2012-04/msg00179.html
    http://patchwork.ozlabs.org/patch/146297/

[2] http://www.linux-mips.org/archives/linux-mips/2012-05/msg00064.html

[3] http://lists.linaro.org/pipermail/linaro-toolchain/2011-November/001869.html

[4] http://lists.linaro.org/pipermail/linaro-dev/2011-December/008880.html

[5] http://www.linux-mips.org/archives/linux-mips/2012-05/msg00070.html

             reply	other threads:[~2014-08-14 22:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14 22:21 Brian Norris [this message]
2014-08-15  9:30 ` Overriding -Werror Jeff Kirsher
2014-08-15 19:33   ` Brian Norris
2014-08-16  3:36     ` Mark D Rustad
2014-08-16  4:34       ` Brian Norris
2014-08-17  6:19         ` Mark D Rustad
2014-08-15 15:33 ` Lennart Sorensen
2014-08-15 16:51   ` Geert Uytterhoeven
2014-08-19 13:15 ` Andi Kleen
2014-08-19 18:43   ` Brian Norris
2014-08-19 20:11   ` Sam Ravnborg
2014-08-19 23:43     ` Andi Kleen
2014-08-20  5:10       ` Sam Ravnborg

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=20140814222119.GD18411@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@linux-mips.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