Decouple HAVE_LLVM from HAVE_GCC. For GCC, add -Wno-format-zero-length

when -Wformat is used.
This commit is contained in:
joerg 2012-03-15 02:00:52 +00:00
parent a42982fe46
commit 17cb70e7b4
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.kmodule.mk,v 1.35 2012/02/19 23:19:37 matt Exp $
# $NetBSD: bsd.kmodule.mk,v 1.36 2012/03/15 02:00:52 joerg Exp $
# We are not building this with PIE
MKPIE=no
@ -18,7 +18,7 @@ CPPFLAGS+= -isystem ${S}/../common/include
CPPFLAGS+= -D_KERNEL -D_LKM -D_MODULE -DSYSCTL_INCLUDE_DESCR
# XXX until the kernel is fixed again...
.if defined(HAVE_GCC) || defined(HAVE_PCC)
.if defined(HAVE_GCC) || defined(HAVE_PCC) || defined(HAVE_LLVM)
CFLAGS+= -fno-strict-aliasing -Wno-pointer-sign
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.sys.mk,v 1.211 2012/01/28 21:32:14 christos Exp $
# $NetBSD: bsd.sys.mk,v 1.212 2012/03/15 02:00:52 joerg Exp $
#
# Build definitions used for NetBSD source tree builds.
@ -13,7 +13,7 @@ CPPFLAGS+= -Wp,-iremap,${DESTDIR}/:/
# Enable c99 mode by default.
# This has the side effect of complaining for missing prototypes
# implicit type declarations and missing return statements.
.if defined(HAVE_GCC)
.if defined(HAVE_GCC) || defined(HAVE_LLVM)
CFLAGS+= -std=gnu99
.endif
@ -59,8 +59,9 @@ CXXFLAGS+= -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
-Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wsynth
CXXFLAGS+= ${${ACTIVE_CXX} == "gcc":? -Wno-non-template-friend -Wno-pmf-conversions :}
.endif
.if ${WARNS} > 3 && defined(HAVE_GCC)
.if ${WARNS} > 3 && (defined(HAVE_GCC) || defined(HAVE_LLVM))
CFLAGS+= -Wsign-compare -Wformat=2
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -Wno-format-zero-length :}
.endif
.if ${WARNS} > 3 && defined(HAVE_LLVM)
CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wpointer-sign -Wmissing-noreturn :}