Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759536Ab3HOSlA (ORCPT ); Thu, 15 Aug 2013 14:41:00 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:40661 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752276Ab3HOSk6 (ORCPT ); Thu, 15 Aug 2013 14:40:58 -0400 From: Sergei Trofimovich To: linux-kernel@vger.kernel.org Cc: Sergei Trofimovich , Michal Marek , linux-kbuild@vger.kernel.org, Andrew Morton Subject: [PATCH v2] Makefile: enable -Werror=implicit-int and -Werror=strict-prototypes by default Date: Thu, 15 Aug 2013 21:37:31 +0300 Message-Id: <1376591851-31854-1-git-send-email-slyfox@gentoo.org> X-Mailer: git-send-email 1.8.3.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1741 Lines: 54 The common error type found in forward-ported/backported patches is missing headers. One recent example (files and function names are mangled): void foo(){} EXPORT_SYMBOL(foo); gave only warning foo.c:12345678:5: warning: function declaration isn't a prototype [-Wstrict-prototypes] void foo(){} ^ foo.c:12345679:5: warning: data definition has no type or storage class [enabled by default] EXPORT_SYMBOL(foo); foo.c:12345679:5: warning: type defaults to 'int' in declaration of 'EXORT_SYMBOL' [-Werror=implicit-int] Now it's a fata error. Tested on x86_64 allyesconfig. Signed-off-by: Sergei Trofimovich Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Cc: Andrew Morton --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) Change since v1: - use 'cc-option' to respect old gccs - fix typos. Thanks to Oleg Verych diff --git a/Makefile b/Makefile index 6e48848..53f4776 100644 --- a/Makefile +++ b/Makefile @@ -374,6 +374,11 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Werror-implicit-function-declaration \ -Wno-format-security \ -fno-delete-null-pointer-checks + +# not universally available, but nice to have ones +KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int) \ + $(call cc-option,-Werror=strict-prototypes) + KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS := -D__ASSEMBLY__ -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/