From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f170.google.com ([209.85.192.170]:33825 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752876AbbC0Rvh (ORCPT ); Fri, 27 Mar 2015 13:51:37 -0400 Received: by pdbni2 with SMTP id ni2so103142887pdb.1 for ; Fri, 27 Mar 2015 10:51:37 -0700 (PDT) From: Jonathan Toppins Subject: [PATCH v2 kbuild for-next 2/2] modpost: add Kconfig option to report warnings as errors Date: Fri, 27 Mar 2015 10:51:11 -0700 Message-Id: <1427478671-16379-2-git-send-email-jtoppins@cumulusnetworks.com> In-Reply-To: <1427478671-16379-1-git-send-email-jtoppins@cumulusnetworks.com> References: <1427478671-16379-1-git-send-email-jtoppins@cumulusnetworks.com> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Michal Marek Cc: linux-kbuild@vger.kernel.org Add a Kconfig option to cause modpost to report warnings as errors. This is a simplistic implementation in that modpost only reports the first warning as an error and subsequent unreported warnings that will kill the build may still exist. v2: * removed DOTs from Kconfig entries Signed-off-by: Jonathan Toppins --- lib/Kconfig.debug | 9 +++++++++ scripts/mod/modpost.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index bbe2eed..94ee0c4 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -357,6 +357,15 @@ config DEBUG_FORCE_CC_WARNINGS_TO_ERRORS If doing new development recommend setting to y. +config DEBUG_FORCE_MODPOST_WARNINGS_TO_ERRORS + bool "Force modpost warnings to errors" + help + Force warnings generated by modpost to be reported as errors. + Another build time setting to encourage some action be taken by + the developer to fix the problem. + + If developing new code say y. + endmenu # "Compiler options" config MAGIC_SYSRQ diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d439856..d430eb6 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -70,6 +70,11 @@ PRINTF void warn(const char *fmt, ...) va_start(arglist, fmt); vfprintf(stderr, fmt, arglist); va_end(arglist); + +#ifdef CONFIG_DEBUG_FORCE_MODPOST_WARNINGS_TO_ERRORS + fprintf(stderr, "modpost: warnings treated as errors.\n"); + exit(1); +#endif } PRINTF void merror(const char *fmt, ...) -- 1.7.10.4