bsd.sys.mk (94332) | bsd.sys.mk (96316) |
---|---|
1# $FreeBSD: head/share/mk/bsd.sys.mk 94332 2002-04-10 02:45:22Z obrien $ | 1# $FreeBSD: head/share/mk/bsd.sys.mk 96316 2002-05-10 01:58:16Z obrien $ |
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 | 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# for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143 10 |
|
9.if !defined(NO_WARNS) 10. if defined(WARNS) 11. if ${WARNS} > 0 12. if !defined(NO_WERROR) 13CFLAGS += -Werror 14. endif 15. endif 16. if ${WARNS} > 1 | 11.if !defined(NO_WARNS) 12. if defined(WARNS) 13. if ${WARNS} > 0 14. if !defined(NO_WERROR) 15CFLAGS += -Werror 16. endif 17. endif 18. if ${WARNS} > 1 |
17CFLAGS += -Wall | 19CFLAGS += -Wall -Wno-format-y2k |
18. endif 19. if ${WARNS} > 2 20CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 21. endif 22. if ${WARNS} > 3 23CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align 24. endif 25. if ${WARNS} > 4 --- 10 unchanged lines hidden (view full) --- 36. endif 37. endif 38 39. if defined(FORMAT_AUDIT) 40WFORMAT = 1 41. endif 42. if defined(WFORMAT) 43. if ${WFORMAT} > 0 | 20. endif 21. if ${WARNS} > 2 22CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 23. endif 24. if ${WARNS} > 3 25CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align 26. endif 27. if ${WARNS} > 4 --- 10 unchanged lines hidden (view full) --- 38. endif 39. endif 40 41. if defined(FORMAT_AUDIT) 42WFORMAT = 1 43. endif 44. if defined(WFORMAT) 45. if ${WFORMAT} > 0 |
44CFLAGS += -Wnon-const-format -Wno-format-extra-args | 46#CFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args 47CFLAGS += -Wformat=2 -Wno-format-extra-args |
45. if !defined(NO_WERROR) 46CFLAGS += -Werror 47. endif 48. endif 49. endif 50.endif 51 52# Allow user-specified additional warning flags 53CFLAGS += ${CWARNFLAGS} 54 55# FreeBSD prior to 4.5 didn't have the __FBSDID() macro in <sys/cdefs.h>. 56.if defined(BOOTSTRAPPING) 57CFLAGS+= -D__FBSDID=__RCSID 58.endif | 48. if !defined(NO_WERROR) 49CFLAGS += -Werror 50. endif 51. endif 52. endif 53.endif 54 55# Allow user-specified additional warning flags 56CFLAGS += ${CWARNFLAGS} 57 58# FreeBSD prior to 4.5 didn't have the __FBSDID() macro in <sys/cdefs.h>. 59.if defined(BOOTSTRAPPING) 60CFLAGS+= -D__FBSDID=__RCSID 61.endif |