aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-26 18:24:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-26 19:25:08 +0000
commite83ffec3af2e71cc64348d58481c87db9efbac92 (patch)
treeb1feb7d85bf82c5633d1146f402d9b31ba2bb805
parent58cd36950cd9d25b680a92a3c275b3bf18a7d407 (diff)
downloadsrc-e83ffec3af2e71cc64348d58481c87db9efbac92.tar.gz
src-e83ffec3af2e71cc64348d58481c87db9efbac92.zip
Suppress -Wstrict-prototypes for several zlib files
Clang 15 is more strict about function definitions not matching declarations, and zlib has a lot of these, but since it is contributed code (and in K&R style to boot), suppress those warnings instead. MFC after: 3 days
-rw-r--r--sys/conf/files9
-rw-r--r--sys/conf/kern.mk3
-rw-r--r--sys/modules/zlib/Makefile3
3 files changed, 12 insertions, 3 deletions
diff --git a/sys/conf/files b/sys/conf/files
index b934bf5124b2..c1d91886ff05 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -4086,7 +4086,8 @@ contrib/zlib/compress.c optional crypto | geom_uzip | \
mxge | ddb_ctf | gzio | zfs | zlib \
compile-with "${NORMAL_C} -Wno-cast-qual"
contrib/zlib/crc32.c optional crypto | geom_uzip | \
- mxge | ddb_ctf | gzio | zfs | zlib
+ mxge | ddb_ctf | gzio | zfs | zlib \
+ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
contrib/zlib/deflate.c optional crypto | geom_uzip | \
mxge | ddb_ctf | gzio | zfs | zlib \
compile-with "${NORMAL_C} -Wno-cast-qual"
@@ -4097,12 +4098,14 @@ contrib/zlib/inflate.c optional crypto | geom_uzip | \
contrib/zlib/inftrees.c optional crypto | geom_uzip | \
mxge | ddb_ctf | gzio | zfs | zlib
contrib/zlib/trees.c optional crypto | geom_uzip | \
- mxge | ddb_ctf | gzio | zfs | zlib
+ mxge | ddb_ctf | gzio | zfs | zlib \
+ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
contrib/zlib/uncompr.c optional crypto | geom_uzip | \
mxge | ddb_ctf | gzio | zfs | zlib \
compile-with "${NORMAL_C} -Wno-cast-qual"
contrib/zlib/zutil.c optional crypto | geom_uzip | \
- mxge | ddb_ctf | gzio | zfs | zlib
+ mxge | ddb_ctf | gzio | zfs | zlib \
+ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}"
dev/zlib/zlib_mod.c optional crypto | geom_uzip | \
mxge | ddb_ctf | gzio | zfs | zlib
dev/zlib/zcalloc.c optional crypto | geom_uzip | \
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index b86149ab4618..4e33db93dafe 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -34,6 +34,9 @@ NO_WUNUSED_BUT_SET_VARIABLE= -Wno-unused-but-set-variable
.if ${COMPILER_VERSION} >= 140000
NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical
.endif
+.if ${COMPILER_VERSION} >= 150000
+NO_WSTRICT_PROTOTYPES= -Wno-strict-prototypes
+.endif
# Several other warnings which might be useful in some cases, but not severe
# enough to error out the whole kernel build. Display them anyway, so there is
# some incentive to fix them eventually.
diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile
index b5f1e552c465..6391255e512b 100644
--- a/sys/modules/zlib/Makefile
+++ b/sys/modules/zlib/Makefile
@@ -21,5 +21,8 @@ SRCS+= zutil.c
CWARNFLAGS.compress.c+=-Wno-cast-qual # compress:49
CWARNFLAGS.deflate.c+=-Wno-cast-qual # deflate.c:415
CWARNFLAGS.uncompr.c+=-Wno-cast-qual # uncompr:49
+CWARNFLAGS.crc32.c+=${NO_WSTRICT_PROTOTYPES} # crc32.c:586
+CWARNFLAGS.trees.c+=${NO_WSTRICT_PROTOTYPES} # trees.c:232
+CWARNFLAGS.zutil.c+=${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32
.include <bsd.kmod.mk>