Deleted Added
full compact
bsd.sys.mk (116342) bsd.sys.mk (124372)
1# $FreeBSD: head/share/mk/bsd.sys.mk 116342 2003-06-14 17:41:59Z imp $
1# $FreeBSD: head/share/mk/bsd.sys.mk 124372 2004-01-11 10:29:55Z ru $
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
11.if !defined(NO_WARNS)
12. if defined(WARNS)
13. if ${WARNS} > 0
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
11.if !defined(NO_WARNS)
12. if defined(WARNS)
13. if ${WARNS} > 0
14CFLAGS += -Wsystem-headers
14CWARNFLAGS += -Wsystem-headers
15. if !defined(NO_WERROR)
15. if !defined(NO_WERROR)
16CFLAGS += -Werror
16CWARNFLAGS += -Werror
17. endif
18. endif
19. if ${WARNS} > 1
17. endif
18. endif
19. if ${WARNS} > 1
20CFLAGS += -Wall -Wno-format-y2k
20CWARNFLAGS += -Wall -Wno-format-y2k
21. endif
22. if ${WARNS} > 2
21. endif
22. if ${WARNS} > 2
23CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
23CWARNFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
24. endif
25. if ${WARNS} > 3
24. endif
25. if ${WARNS} > 3
26CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
26CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
27. endif
28# BDECFLAGS
29. if ${WARNS} > 5
27. endif
28# BDECFLAGS
29. if ${WARNS} > 5
30CFLAGS += -Wbad-function-cast -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
30CWARNFLAGS += -Wbad-function-cast -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
31. endif
32. if ${WARNS} > 1 && ${WARNS} < 5
33# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
34# XXX always get it right.
31. endif
32. if ${WARNS} > 1 && ${WARNS} < 5
33# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
34# XXX always get it right.
35CFLAGS += -Wno-uninitialized
35CWARNFLAGS += -Wno-uninitialized
36. endif
37. endif
38
39. if defined(FORMAT_AUDIT)
40WFORMAT = 1
41. endif
42. if defined(WFORMAT)
43. if ${WFORMAT} > 0
36. endif
37. endif
38
39. if defined(FORMAT_AUDIT)
40WFORMAT = 1
41. endif
42. if defined(WFORMAT)
43. if ${WFORMAT} > 0
44#CFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
45CFLAGS += -Wformat=2 -Wno-format-extra-args
44#CWARNFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
45CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
46. if !defined(NO_WERROR)
46. if !defined(NO_WERROR)
47CFLAGS += -Werror
47CWARNFLAGS += -Werror
48. endif
49. endif
50. endif
51.endif
52
53# Allow user-specified additional warning flags
54CFLAGS += ${CWARNFLAGS}
48. endif
49. endif
50. endif
51.endif
52
53# Allow user-specified additional warning flags
54CFLAGS += ${CWARNFLAGS}