sys: Stop enabling -Wnested-externs.

clang doesn't implement this warning, so violations are only caught by
GCC.  It is also no longer a common practice to use this as it was in
the original BSD code, so the need for the warning is not as important
as when it was used to do cleanups 20 years ago.  A recent commit
(c3179891f8) triggers this warning on
GCC, but that commit uses nested externs purposefully.

Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39214
This commit is contained in:
John Baldwin 2023-03-22 12:35:09 -07:00
parent 7bf44831ca
commit 4ffeb3b88e
4 changed files with 2 additions and 5 deletions

View File

@ -3,7 +3,7 @@
#
# Warning flags for compiling the kernel and components of the kernel:
#
CWARNFLAGS?= -Wall -Wnested-externs -Wstrict-prototypes \
CWARNFLAGS?= -Wall -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Wcast-qual \
-Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \
-Wmissing-include-dirs -fdiagnostics-show-option \

View File

@ -225,7 +225,6 @@ CDDL_CFLAGS= \
-Wno-duplicate-decl-specifier \
-Wno-missing-braces \
-Wno-missing-prototypes \
-Wno-nested-externs \
-Wno-parentheses \
-Wno-pointer-arith \
-Wno-strict-prototypes \

View File

@ -551,8 +551,7 @@ OPENZFS_CFLAGS= \
-I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
OPENZFS_CWARNFLAGS= \
-Wno-nested-externs
OPENZFS_CWARNFLAGS=
.include <bsd.dep.mk>
.include <bsd.clang-analyze.mk>

View File

@ -22,7 +22,6 @@ CFLAGS+=-fms-extensions
CFLAGS+=-Wredundant-decls
CFLAGS+=-Wunused-variable
CFLAGS+=-Wnested-externs
CFLAGS+=-Woverflow
CFLAGS+=-Wmissing-prototypes
CFLAGS+=-Wparentheses