From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@linux-foundation.org
Cc: dhowells@redhat.com, bunk@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] Werror: Provide a configuration option to enable -Werror
Date: Thu, 29 May 2008 19:17:51 +0100 [thread overview]
Message-ID: <20080529181751.5396.57465.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20080529181726.5396.79336.stgit@warthog.procyon.org.uk>
Provide a configuration option to enable -Werror and make it work for x86_64
allyesconfig with __deprecated and __must_check checking disabled.
Note that it _won't_ be turned on for allyesconfig as it is suppressed by
ENABLE_WARN_DEPRECATED or ENABLE_MUST_CHECK being enabled.
Additionally, the advansys driver has its complaint about not being coverted
to the DMA API suppressed if this option is enabled.
Subject to those conditions, x86_64 allyesconfig will build with this option
enabled, if ENABLE_WARN_DEPRECATED and ENABLE_MUST_CHECK are manually disabled
and ENABLE_WERROR enabled.
Signed-off-by: David Howells <dhowells@redhat.com>
---
Makefile | 4 ++++
drivers/scsi/advansys.c | 2 ++
lib/Kconfig.debug | 8 ++++++++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 8db70fe..f40d5c1 100644
--- a/Makefile
+++ b/Makefile
@@ -528,6 +528,10 @@ KBUILD_CFLAGS += -g
KBUILD_AFLAGS += -gdwarf-2
endif
+ifdef CONFIG_ENABLE_WERROR
+KBUILD_CFLAGS += -Werror
+endif
+
# We trigger additional mismatches with less inlining
ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 8591585..539d22f 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -68,7 +68,9 @@
* 7. advansys_info is not safe against multiple simultaneous callers
* 8. Add module_param to override ISA/VLB ioport array
*/
+#ifndef CONFIG_ENABLE_WERROR
#warning this driver is still not properly converted to the DMA API
+#endif
/* Enable driver /proc statistics. */
#define ADVANSYS_STATS
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d2099f4..3efca43 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -25,6 +25,14 @@ config ENABLE_MUST_CHECK
suppress the "warning: ignoring return value of 'foo', declared with
attribute warn_unused_result" messages.
+config ENABLE_WERROR
+ bool "Enable -Werror"
+ default n
+ depends on !ENABLE_WARN_DEPRECATED && !ENABLE_MUST_CHECK
+ help
+ Enable -Werror on building C files. This causes all warnings to
+ abort the compilation, just as errors do.
+
config FRAME_WARN
int "Warn for stack frames larger than (needs gcc 4.4)"
range 0 8192
next prev parent reply other threads:[~2008-05-29 18:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-29 18:17 [PATCH 1/6] Werror: Fix casting wrong size integer to pointer David Howells
2008-05-29 18:17 ` [PATCH 2/6] Werror: Hide epca_setup() as it's unused David Howells
2008-05-29 18:35 ` Alan Cox
2008-05-29 18:17 ` [PATCH 3/6] Werror: Remove iiEllisCleanup() " David Howells
2008-05-29 18:28 ` Adrian Bunk
2008-05-29 18:35 ` Alan Cox
2008-05-29 19:07 ` David Howells
2008-05-29 18:17 ` [PATCH 4/6] Werror: Hide warnings on static module device tables David Howells
2008-05-29 19:24 ` Adrian Bunk
2008-05-29 19:41 ` David Howells
2008-05-29 19:50 ` Adrian Bunk
2008-05-29 18:17 ` [PATCH 5/6] Werror: Remove the packed attribute from PofTimStamp_tag in the hysdn driver David Howells
2008-05-29 19:24 ` Andrew Morton
2008-05-29 18:17 ` David Howells [this message]
2008-05-29 18:30 ` [PATCH 6/6] Werror: Provide a configuration option to enable -Werror Linus Torvalds
2008-05-29 18:29 ` [PATCH 1/6] Werror: Fix casting wrong size integer to pointer Linus Torvalds
2008-05-29 18:48 ` David Howells
2008-05-29 19:19 ` Andrew Morton
2008-05-29 19:25 ` David Howells
2008-05-29 20:08 ` Andrew Morton
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=20080529181751.5396.57465.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®