1 # $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $
2 # $DragonFly: src/share/mk/bsd.sys.mk,v 1.7 2005/07/08 13:05:53 joerg Exp $
4 # This file contains common settings used for building FreeBSD
7 # Enable various levels of compiler warning checks. These may be
8 # overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
10 .if !defined(NO_WARNS)
12 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
13 # XXX always get it right.
15 CFLAGS += -Wno-uninitialized
17 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
21 CFLAGS += -Wunknown-pragmas
23 CFLAGS += -Wsystem-headers
30 CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
33 CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
36 CFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
40 . if defined(FORMAT_AUDIT)
45 CFLAGS += -Wno-format-extra-args
47 CFLAGS += -Wnon-const-format
49 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
56 .if defined(WARNS_NO_UNUSED_PARAMETERS)
57 CFLAGS+= -Wno-unused-parameters
60 # Allow user-specified additional warning flags
61 CFLAGS += ${CWARNFLAGS}