All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 kbuild for-next 1/2] makefiles: add config option to force all cc warnings to errors
@ 2015-03-27 17:51 Jonathan Toppins
  2015-03-27 17:51 ` [PATCH v2 kbuild for-next 2/2] modpost: add Kconfig option to report warnings as errors Jonathan Toppins
  2015-03-30 13:35 ` [PATCH v2 kbuild for-next 1/2] makefiles: add config option to force all cc warnings to errors Michal Marek
  0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Toppins @ 2015-03-27 17:51 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Add a Kconfig option to force cc warnings to errors. For new
development it is recommended this setting be enabled as warnings
in the code will be quite obvious.

v2: * remove DOTs from Kconfig entries
    * reworded Kconfig to not imply suppressing cc warnings was
      acceptable
    * default option to 'n'

Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
---
 Makefile          |    4 ++++
 lib/Kconfig.debug |   10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/Makefile b/Makefile
index dc2d91a..a69562a 100644
--- a/Makefile
+++ b/Makefile
@@ -764,6 +764,10 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
 KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
 endif
 
+ifdef CONFIG_DEBUG_FORCE_CC_WARNINGS_TO_ERRORS
+KBUILD_CFLAGS += $(call cc-option, -Werror)
+endif
+
 # arch Makefile may override CC so keep this after arch Makefile is included
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 CHECKFLAGS     += $(NOSTDINC_FLAGS)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 3e0289e..bbe2eed 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -347,6 +347,16 @@ config DEBUG_FORCE_WEAK_PER_CPU
 	  To ensure that generic code follows the above rules, this
 	  option forces all percpu variables to be defined as weak.
 
+config DEBUG_FORCE_CC_WARNINGS_TO_ERRORS
+	bool "Force cc warnings to errors"
+	help
+	  Simply enables the gcc compiler option -Werror for the entire
+	  build. This option is intended to be more in the developer's
+	  face and encourage effort of some kind to remove the
+	  compilation warning.
+
+	  If doing new development recommend setting to y.
+
 endmenu # "Compiler options"
 
 config MAGIC_SYSRQ
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-30 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-27 17:51 [PATCH v2 kbuild for-next 1/2] makefiles: add config option to force all cc warnings to errors Jonathan Toppins
2015-03-27 17:51 ` [PATCH v2 kbuild for-next 2/2] modpost: add Kconfig option to report warnings as errors Jonathan Toppins
2015-03-30 13:35 ` [PATCH v2 kbuild for-next 1/2] makefiles: add config option to force all cc warnings to errors Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.