aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-25 10:29:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-12-25 11:58:22 +0000
commit526f57bf85a2b9b113c55ded47b932abc8567bc5 (patch)
tree6fd8b6f0f702ffd67df6cf02843a628b75a272f0
parentf126d349810fdb512c0b01e101342d430b947488 (diff)
downloadsrc-526f57bf85a2b9b113c55ded47b932abc8567bc5.tar.gz
src-526f57bf85a2b9b113c55ded47b932abc8567bc5.zip
Update CWARNFLAGS in bsd.sys.mk and CWARNEXTRA in kern.mk for clang 15.
MFC after: 3 days
-rw-r--r--share/mk/bsd.sys.mk17
-rw-r--r--sys/conf/kern.mk4
2 files changed, 19 insertions, 2 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index a220c9d173ed..43359fed29c7 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -49,8 +49,11 @@ CWARNFLAGS+= -Werror
CWARNFLAGS+= -Wall -Wno-format-y2k
.endif # WARNS >= 2
.if ${WARNS} >= 3
-CWARNFLAGS+= -W -Wno-unused-parameter -Wstrict-prototypes\
- -Wmissing-prototypes -Wpointer-arith
+CWARNFLAGS+= -W -Wno-unused-parameter
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 150000
+CWARNFLAGS+= -Wstrict-prototypes
+.endif
+CWARNFLAGS+= -Wmissing-prototypes -Wpointer-arith
.endif # WARNS >= 3
.if ${WARNS} >= 4
CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\
@@ -59,6 +62,11 @@ CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\
CWARNFLAGS+= -Wcast-align
.endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE}
.endif # WARNS >= 4
+.if ${WARNS} >= 5
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000
+CWARNFLAGS+= -Wstrict-prototypes
+.endif
+.endif # WARNS >= 4
.if ${WARNS} >= 6
CWARNFLAGS+= -Wchar-subscripts -Wnested-externs \
-Wold-style-definition
@@ -86,6 +94,11 @@ CWARNFLAGS.clang+= -Wno-unused-const-variable
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000
CWARNFLAGS.clang+= -Wno-error=unused-but-set-variable
.endif
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000
+CWARNFLAGS.clang+= -Wno-error=array-parameter
+CWARNFLAGS.clang+= -Wno-error=deprecated-non-prototype
+CWARNFLAGS.clang+= -Wno-error=unused-but-set-parameter
+.endif
.endif # WARNS <= 6
.if ${WARNS} <= 3
CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index c44e5065da70..9b33c7b82125 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -45,6 +45,10 @@ CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \
-Wno-error=pointer-sign
CWARNEXTRA+= -Wno-error=shift-negative-value
CWARNEXTRA+= -Wno-address-of-packed-member
+.if ${COMPILER_VERSION} >= 150000
+CWARNEXTRA+= -Wno-error=array-parameter
+CWARNEXTRA+= -Wno-error=deprecated-non-prototype
+.endif
.endif # clang
.if ${COMPILER_TYPE} == "gcc"