1# $FreeBSD$ 2# 3# This file contains common settings used for building FreeBSD 4# sources. 5 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. 8 9.if !defined(NO_WARNS) 10. if defined(WARNS) 11. if ${WARNS} > 0 12CFLAGS += -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 13# XXX Delete -Wuninitialized by default for now -- the compiler doesn't 14# XXX always get it right. 15CFLAGS += -Wno-uninitialized 16. if !defined(NO_WERROR) 17CFLAGS += -Werror 18. endif 19. endif 20. if ${WARNS} > 1 21CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow 22. endif 23. endif 24 25. if defined(FORMAT_AUDIT) 26WFORMAT = 1 27. endif 28. if defined(WFORMAT) 29. if ${WFORMAT} > 0 30CFLAGS += -Wnon-const-format -Wno-format-extra-args 31. if !defined(NO_WERROR) 32CFLAGS += -Werror 33. endif 34. endif 35. endif 36.endif 37 38# Allow user-specified additional warning flags 39CFLAGS += ${CWARNFLAGS} 40