3 # This file contains common settings used for building FreeBSD
6 # Enable various levels of compiler warning checks. These may be
7 # overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
9 # for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143
11 .if !defined(NO_WARNS) && ${CC} != "icc"
14 CWARNFLAGS += -Wsystem-headers
15 . if !defined(NO_WERROR)
20 CWARNFLAGS += -Wall -Wno-format-y2k
23 CWARNFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
26 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
30 CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
32 . if ${WARNS} >= 2 && ${WARNS} <= 4
33 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
34 # XXX always get it right.
35 CWARNFLAGS += -Wno-uninitialized
39 . if defined(FORMAT_AUDIT)
44 #CWARNFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
45 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
46 . if !defined(NO_WERROR)
53 # Allow user-specified additional warning flags
54 CFLAGS += ${CWARNFLAGS}