git: 429d95658672 - stable/12 - Stop adding -Wredundant-decls to CWARNFLAGS.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 22 Mar 2023 22:28:41 UTC
The branch stable/12 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=429d9565867246e6483d025c2c2f136157b57e66

commit 429d9565867246e6483d025c2c2f136157b57e66
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-02-07 20:47:51 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-03-22 19:28:59 +0000

    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)
---
 share/mk/bsd.sys.mk        | 2 +-
 sys/conf/kern.mk           | 2 +-
 sys/conf/kern.pre.mk       | 2 +-
 sys/powerpc/conf/QORIQ64   | 2 +-
 sys/powerpc/conf/dpaa/DPAA | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 45f0dcc2c6cf..029af7ae4fd1 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -62,7 +62,7 @@ CWARNFLAGS+=	-Wcast-align
 .endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE}
 .endif # WARNS >= 4
 .if ${WARNS} >= 6
-CWARNFLAGS+=	-Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\
+CWARNFLAGS+=	-Wchar-subscripts -Winline -Wnested-externs \
 		-Wold-style-definition
 .if !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
 CWARNFLAGS.clang+=	-Wmissing-variable-declarations
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 0f311fba2b23..243419103b22 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 7f0099344d18..f0b314e29307 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -171,7 +171,7 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
 ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC}
 
 # Common for dtrace / zfs
-CDDL_CFLAGS=	-DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
+CDDL_CFLAGS=	-DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
 CDDL_CFLAGS+=	-include $S/cddl/compat/opensolaris/sys/debug_compat.h
 CDDL_C=		${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
 
diff --git a/sys/powerpc/conf/QORIQ64 b/sys/powerpc/conf/QORIQ64
index 348150e83d05..02bbb2585647 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 315461fb95ac..761dfbd85ba8 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