linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud@opteya.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yann Droneaud <ydroneaud@opteya.com>
Subject: [PATCH] kbuild: support W=e to make build abort in case of warning
Date: Sun,  1 Feb 2015 16:15:20 +0100	[thread overview]
Message-ID: <1422803720-14723-1-git-send-email-ydroneaud@opteya.com> (raw)

In order to piss off^W^Whelp people trying to fix warnings,
this patch introduces a new 'e' modifier to W= as a short
hand for KCFLAGS+=-Werror" so that -Werror got added to
the kernel (built-in) and modules' CFLAGS and makes the
build abort when any warning is reported by the compiler.

In the end, people not sane enough can do not so useful
thing such as 'make W=123e'.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
---
 Makefile                   | 1 +
 scripts/Makefile.extrawarn | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 6b69223a5267..42fd50d939e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1338,6 +1338,7 @@ help:
 	@echo  '		1: warnings which may be relevant and do not occur too often'
 	@echo  '		2: warnings which occur quite often but may still be relevant'
 	@echo  '		3: more obscure warnings, can most likely be ignored'
+	@echo  '		e: warnings are being treated as errors'
 	@echo  '		Multiple levels can be combined with W=12 or W=123'
 	@echo  ''
 	@echo  'Execute "make" or "make all" to build all targets marked with [*] '
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index f734033af219..798796e078d9 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -5,6 +5,7 @@
 # W=1 - warnings that may be relevant and does not occur too often
 # W=2 - warnings that occur quite often but may still be relevant
 # W=3 - the more obscure warnings, can most likely be ignored
+# W=e - warnings are being treated as errors
 #
 # $(call cc-option, -W...) handles gcc -W.. options which
 # are not supported by all versions of the compiler
@@ -45,9 +46,12 @@ warning-3 += -Wswitch-default
 warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
 warning-3 += $(call cc-option, -Wvla)
 
+warning-e := -Werror
+
 warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
 warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
 warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+warning += $(warning-$(findstring e, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
 
 ifeq ("$(strip $(warning))","")
         $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
-- 
2.1.0


             reply	other threads:[~2015-02-01 20:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-01 15:15 Yann Droneaud [this message]
2022-04-08  8:46 ` [PATCHv1] kbuild: support W=e to make build abort in case of warning Yann Droneaud
2022-04-08 11:05   ` Masahiro Yamada
2022-04-08 20:29     ` Nick Desaulniers
2022-04-08 20:36       ` Randy Dunlap
2022-04-09  1:47         ` Masahiro Yamada
2022-04-09  1:54           ` Randy Dunlap
2022-04-14 13:09           ` Nicolas Schier
2022-04-14 15:15             ` Masahiro Yamada
2022-04-14 17:51               ` Nicolas Schier
2022-04-14 20:14                 ` Nicolas Schier
2022-04-20 16:21   ` 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=1422803720-14723-1-git-send-email-ydroneaud@opteya.com \
    --to=ydroneaud@opteya.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).