git: 4ffeb3b88ed2 - main - sys: Stop enabling -Wnested-externs.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Mar 2023 19:35:49 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=4ffeb3b88ed228e72e13abe1be888c77c6ede95d
commit 4ffeb3b88ed228e72e13abe1be888c77c6ede95d
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-22 19:35:09 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-03-22 19:35:09 +0000
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
(c3179891f897d840f578a5139839fcacb587c96d) triggers this warning on
GCC, but that commit uses nested externs purposefully.
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D39214
---
sys/conf/kern.mk | 2 +-
sys/conf/kern.pre.mk | 1 -
sys/conf/kmod.mk | 3 +--
sys/modules/pms/Makefile | 1 -
4 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 74c47479ab9e..a80d6211c182 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 -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 \
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ca04e348808d..ec5c1d331533 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -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 \
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 9c681bad3c80..83506ece333d 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -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>
diff --git a/sys/modules/pms/Makefile b/sys/modules/pms/Makefile
index 4dc00b75ff6f..3219b3e0e4a3 100644
--- a/sys/modules/pms/Makefile
+++ b/sys/modules/pms/Makefile
@@ -22,7 +22,6 @@ CFLAGS+=-fms-extensions
CFLAGS+=-Wredundant-decls
CFLAGS+=-Wunused-variable
-CFLAGS+=-Wnested-externs
CFLAGS+=-Woverflow
CFLAGS+=-Wmissing-prototypes
CFLAGS+=-Wparentheses