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.12 2008/11/14 15:04:42 swildner Exp $
4 # This file contains common settings used for building DragonFly
10 CFLAGS += -traditional
11 .elif ${CSTD} == "c89" || ${CSTD} == "c90"
12 CFLAGS += -std=iso9899:1990
13 .elif ${CSTD} == "c94" || ${CSTD} == "c95"
14 CFLAGS += -std=iso9899:199409
15 .elif ${CSTD} == "c99"
16 CFLAGS += -std=iso9899:1999
18 CFLAGS += -std=${CSTD}
21 # Enable various levels of compiler warning checks. These may be
22 # overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
24 .if !defined(NO_WARNS)
27 CWARNFLAGS += -Wsystem-headers
28 . if !defined(NO_WERROR) && ${CCVER} == "gcc41"
36 CWARNFLAGS += -W -Wno-unused-parameter -Wstrict-prototypes\
37 -Wmissing-prototypes -Wpointer-arith\
38 -Wold-style-definition
41 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\
42 -Wshadow -Wcast-align -Wunused-parameter
45 CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
47 . if ${WARNS} >= 2 && ${WARNS} <= 4
48 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
49 # XXX always get it right.
50 CWARNFLAGS += -Wno-uninitialized
54 . if defined(FORMAT_AUDIT)
59 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
60 . if !defined(NO_WERROR) && ${CCVER} == "gcc41"
67 # Allow user-specified additional warning flags
68 CFLAGS += ${CWARNFLAGS}