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
This commit is contained in:
John Baldwin 2022-02-07 12:47:51 -08:00
parent 4e46c6fb35
commit c227269e2f
9 changed files with 7 additions and 12 deletions

View File

@ -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
@ -163,7 +163,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

View File

@ -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

View File

@ -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 \

View File

@ -228,7 +228,6 @@ CDDL_CFLAGS= \
-Wno-nested-externs \
-Wno-parentheses \
-Wno-pointer-arith \
-Wno-redundant-decls \
-Wno-strict-prototypes \
-Wno-switch \
-Wno-undef \
@ -298,7 +297,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}

View File

@ -544,8 +544,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>

View File

@ -56,4 +56,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

View File

@ -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

View File

@ -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

View File

@ -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 \