aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-02-07 20:47:51 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2023-03-22 15:22:07 +0000
commit419f53cb21eba7aa22990d65e7a4656dcf8b3725 (patch)
treed1173a3cfdf9f6a52de314ffd98728fc5a3bc826
parentf31f677c1d418834999038a7767fb77668bccf31 (diff)
downloadsrc-419f53cb21eba7aa22990d65e7a4656dcf8b3725.tar.gz
src-419f53cb21eba7aa22990d65e7a4656dcf8b3725.zip
Stop adding -Wredundant-decls to CWARNFLAGS.
clang doesn't implement it, and Linux doesn't enforce it. As a result, new instances keep cropping up both in FreeBSD's code and in upstream sources from vendors. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D34144 (cherry picked from commit c227269e2f9dc2695d00be9e5a72b5fdeec5712a)
-rw-r--r--share/mk/bsd.sys.mk3
-rw-r--r--sys/conf/Makefile.powerpc1
-rw-r--r--sys/conf/kern.mk2
-rw-r--r--sys/conf/kern.pre.mk3
-rw-r--r--sys/conf/kmod.mk3
-rw-r--r--sys/modules/ibcore/Makefile2
-rw-r--r--sys/powerpc/conf/QORIQ642
-rw-r--r--sys/powerpc/conf/dpaa/DPAA2
-rw-r--r--sys/powerpc/conf/dpaa/config.dpaa1
9 files changed, 7 insertions, 12 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 9e41fefc4fe4..25e2c9787329 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -60,7 +60,7 @@ CWARNFLAGS+= -Wcast-align
.endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE}
.endif # WARNS >= 4
.if ${WARNS} >= 6
-CWARNFLAGS+= -Wchar-subscripts -Wnested-externs -Wredundant-decls\
+CWARNFLAGS+= -Wchar-subscripts -Wnested-externs \
-Wold-style-definition
.if !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
CWARNFLAGS.clang+= -Wmissing-variable-declarations
@@ -172,7 +172,6 @@ CWARNFLAGS+= -Wno-error=address \
CWARNFLAGS+= -Wno-error=empty-body \
-Wno-error=maybe-uninitialized \
-Wno-error=nonnull-compare \
- -Wno-error=redundant-decls \
-Wno-error=shift-negative-value \
-Wno-error=tautological-compare \
-Wno-error=unused-const-variable
diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc
index a933c6b42090..839fde10f9b2 100644
--- a/sys/conf/Makefile.powerpc
+++ b/sys/conf/Makefile.powerpc
@@ -53,7 +53,6 @@ DPAAWARNFLAGS += \
-Wno-error=enum-conversion
.elif "${COMPILER_TYPE}" == "gcc"
DPAAWARNFLAGS += \
- -Wno-error=redundant-decls \
-Wno-error=int-in-bool-context
.endif
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 13cf41f05a24..1144522c357b 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -3,7 +3,7 @@
#
# Warning flags for compiling the kernel and components of the kernel:
#
-CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
+CWARNFLAGS?= -Wall -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Wcast-qual \
-Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \
-Wmissing-include-dirs -fdiagnostics-show-option \
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 6af49075cae8..5fba3e58295b 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -249,7 +249,6 @@ CDDL_CFLAGS= \
-Wno-nested-externs \
-Wno-parentheses \
-Wno-pointer-arith \
- -Wno-redundant-decls \
-Wno-strict-prototypes \
-Wno-switch \
-Wno-undef \
@@ -320,7 +319,7 @@ LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES}
# Infiniband C flags. Correct include paths and omit errors that linux
# does not honor.
OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES}
-OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -Wno-redundant-decls
+OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith
OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \
${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 2a2ab1d02277..134b150af1d9 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -551,8 +551,7 @@ OPENZFS_CFLAGS= \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
OPENZFS_CWARNFLAGS= \
- -Wno-nested-externs \
- -Wno-redundant-decls
+ -Wno-nested-externs
.include <bsd.dep.mk>
.include <bsd.clang-analyze.mk>
diff --git a/sys/modules/ibcore/Makefile b/sys/modules/ibcore/Makefile
index 801fcf9345ef..64444bd9925b 100644
--- a/sys/modules/ibcore/Makefile
+++ b/sys/modules/ibcore/Makefile
@@ -43,4 +43,4 @@ EXPORT_SYMS= YES
.include <bsd.kmod.mk>
-CWARNFLAGS+= -Wno-cast-qual -Wno-pointer-arith -Wno-redundant-decls
+CWARNFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/powerpc/conf/QORIQ64 b/sys/powerpc/conf/QORIQ64
index 4131ed5935b5..5db473c5393b 100644
--- a/sys/powerpc/conf/QORIQ64
+++ b/sys/powerpc/conf/QORIQ64
@@ -14,7 +14,7 @@ machine powerpc powerpc64
include "dpaa/config.dpaa"
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
makeoptions WITH_CTF=1
-#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls"
+#makeoptions WERROR="-Werror -Wno-format"
options FPU_EMU
diff --git a/sys/powerpc/conf/dpaa/DPAA b/sys/powerpc/conf/dpaa/DPAA
index 23b708591378..4032c2ddd446 100644
--- a/sys/powerpc/conf/dpaa/DPAA
+++ b/sys/powerpc/conf/dpaa/DPAA
@@ -12,7 +12,7 @@ cpu BOOKE_E500
machine powerpc powerpc
#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
-#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls"
+#makeoptions WERROR="-Werror -Wno-format"
makeoptions NO_MODULES=yes
# Platform support
diff --git a/sys/powerpc/conf/dpaa/config.dpaa b/sys/powerpc/conf/dpaa/config.dpaa
index a40e3e5ea8bc..6161eb7db4a6 100644
--- a/sys/powerpc/conf/dpaa/config.dpaa
+++ b/sys/powerpc/conf/dpaa/config.dpaa
@@ -6,7 +6,6 @@ makeoptions DPAA_COMPILE_CMD="${LINUXKPI_C} ${DPAAWARNFLAGS} \
-Wno-cast-qual -Wno-unused-function -Wno-init-self -fms-extensions \
-include $S/contrib/ncsw/build/dflags.h \
-Wno-error=missing-prototypes \
- -Wno-redundant-decls \
-I$S/contrib/ncsw/build/ \
-I$S/contrib/ncsw/inc \
-I$S/contrib/ncsw/inc/cores \