From: behanw@converseincode.com
To: mmarek@suse.cz
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
dwmw2@infradead.org, pageexec@freemail.hu,
"Jan-Simon Möller" <dl9pf@gmx.de>,
"Behan Webster" <behanw@converseincode.com>,
"Mark Charlebois" <mcharleb@gmail.com>
Subject: [PATCH 2/5 v2] kbuild: LLVMLinux: Adapt warnings for compilation with clang
Date: Thu, 6 Mar 2014 09:59:23 -0800 [thread overview]
Message-ID: <1394128763-2976-1-git-send-email-behanw@converseincode.com> (raw)
In-Reply-To: <1393376923-21892-3-git-send-email-behanw@converseincode.com>
From: Jan-Simon Möller <dl9pf@gmx.de>
When compiling kernel with clang, disable warnings which are too noisy, and
add the clang flag catch-undefined-behavior.
Re-enable warnings for self-assigns due to David Jones removing most of them
already from the kernel code base.
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Mark Charlebois <mcharleb@gmail.com>
Cc: PaX Team <pageexec@freemail.hu>
---
scripts/Makefile.build | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d5d859c..5cd6651 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -65,12 +65,22 @@ warning- := $(empty)
warning-1 := -Wextra -Wunused -Wno-unused-parameter
warning-1 += -Wmissing-declarations
warning-1 += -Wmissing-format-attribute
-warning-1 += -Wmissing-prototypes
+warning-1 += $(call cc-option, -Wmissing-prototypes)
warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
+# Clang
+warning-1 += $(call cc-disable-warning, initializer-overrides)
+warning-1 += $(call cc-disable-warning, unused-value)
+warning-1 += $(call cc-disable-warning, format)
+warning-1 += $(call cc-disable-warning, unknown-warning-option)
+warning-1 += $(call cc-disable-warning, sign-compare)
+warning-1 += $(call cc-disable-warning, format-zero-length)
+warning-1 += $(call cc-disable-warning, uninitialized)
+warning-1 += $(call cc-option, -fcatch-undefined-behavior)
+
warning-2 := -Waggregate-return
warning-2 += -Wcast-align
warning-2 += -Wdisabled-optimization
--
1.8.3.2
next prev parent reply other threads:[~2014-03-06 17:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 1:08 [PATCH 0/5] kbuild: LLVMLinux: Initial updates to kbuild to enable the kernel to be compiled with clang/LLVM behanw
2014-02-26 1:08 ` [PATCH 1/5] kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang behanw
2014-03-09 21:58 ` Sam Ravnborg
2014-03-11 6:58 ` Behan Webster
2014-03-11 21:26 ` [PATCH 1/5 v2] " behanw
2014-02-26 1:08 ` [PATCH 2/5] kbuild: LLVMLinux: Adapt warnings for compilation with clang behanw
2014-02-26 1:17 ` Dave Jones
2014-02-26 1:31 ` Behan Webster
2014-02-26 1:34 ` H. Peter Anvin
2014-02-26 2:38 ` Behan Webster
2014-03-06 17:59 ` behanw [this message]
2014-02-26 1:08 ` [PATCH 3/5] kbuild: LLVMLinux: Fix LINUX_COMPILER definition script " behanw
2014-02-26 1:08 ` [PATCH 4/5] LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h behanw
2014-02-26 1:08 ` [PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang behanw
2014-02-26 1:32 ` H. Peter Anvin
2014-02-26 1:44 ` Behan Webster
2014-03-06 18:03 ` [PATCH 5/5 v2] " behanw
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=1394128763-2976-1-git-send-email-behanw@converseincode.com \
--to=behanw@converseincode.com \
--cc=dl9pf@gmx.de \
--cc=dwmw2@infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcharleb@gmail.com \
--cc=mmarek@suse.cz \
--cc=pageexec@freemail.hu \
/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).