Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 2023 00:29:55 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a5cc1f650ca3 - stable/13 - sys: Stop enabling -Wnested-externs.
Message-ID:  <202305030029.3430TtqZ072309@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

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

commit a5cc1f650ca30144badf10fbd5c37f0fe7d7c36b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-22 19:35:09 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-05-03 00:19:51 +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
    
    (cherry picked from commit 4ffeb3b88ed228e72e13abe1be888c77c6ede95d)
---
 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 281c49c7c850..d37d80793929 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 a12aff2c2816..3105d2c32c8f 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -246,7 +246,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 134b150af1d9..a952e3190dec 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -550,8 +550,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305030029.3430TtqZ072309>