[PATCH] manywarnings: -Wstrict-overflow is deprecated

Paul Eggert <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
Issue reported by Drea Pinski in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101913#c6
* HACKING: Stop recommending -Wstrict-overflow.
* build-aux/g++-warning.spec:
* build-aux/gcc-warning.spec: Say -Wstrict-overflow is deprecated.
* doc/manywarnings.texi (manywarnings): Stop mentioning it.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Stop using it.
---
 ChangeLog                  | 13 +++++++++++++
 HACKING                    |  2 --
 build-aux/g++-warning.spec |  2 +-
 build-aux/gcc-warning.spec |  3 ++-
 doc/manywarnings.texi      |  3 +--
 m4/manywarnings-c++.m4     |  1 -
 m4/manywarnings.m4         |  1 -
 7 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 838fcc0d63..977c787a34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-05-28  Paul Eggert  <[email protected]>
+
+	manywarnings: -Wstrict-overflow is deprecated
+	Issue reported by Drea Pinski in:
+	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101913#c6
+	* HACKING: Stop recommending -Wstrict-overflow.
+	* build-aux/g++-warning.spec:
+	* build-aux/gcc-warning.spec: Say -Wstrict-overflow is deprecated.
+	* doc/manywarnings.texi (manywarnings): Stop mentioning it.
+	* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
+	* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
+	Stop using it.
+
 2026-05-27  Bruno Haible  <[email protected]>
 
 	fma: Work around glibc 2.43 regression.
diff --git a/HACKING b/HACKING
index 33628eafc0..f622b8be95 100644
--- a/HACKING
+++ b/HACKING
@@ -315,7 +315,6 @@ there are three possible approaches:
       -Woverlength-strings
       -Wpacked
       -Wpointer-arith
-      -Wstrict-overflow
       -Wsuggest-final-methods
       -Wsuggest-final-types
       -Wsync-nand
@@ -399,7 +398,6 @@ there are three possible approaches:
       -Woverlength-strings
       -Wpacked
       -Wpointer-arith
-      -Wstrict-overflow
       -Wsuggest-attribute=format
       -Wsuggest-final-methods
       -Wsuggest-final-types
diff --git a/build-aux/g++-warning.spec b/build-aux/g++-warning.spec
index 2235d65e60..7d83432ef8 100644
--- a/build-aux/g++-warning.spec
+++ b/build-aux/g++-warning.spec
@@ -78,7 +78,7 @@
 -Wsign-conversion			FIXME maybe? borderline.  some will want this
 -Wstack-usage=				FIXME: choose something sane?
 -Wstrict-aliasing=			FIXME: choose something sane?
--Wstrict-overflow=			FIXME: choose something sane?
+-Wstrict-overflow=			deprecated and slated for removal
 -Wstrict-prototypes			c
 -Wstrict-selector-match			objc and objc++
 -Wsurprising				fortran
diff --git a/build-aux/gcc-warning.spec b/build-aux/gcc-warning.spec
index f0843acc49..6bf931808e 100644
--- a/build-aux/gcc-warning.spec
+++ b/build-aux/gcc-warning.spec
@@ -246,7 +246,8 @@
 -Wstack-usage=<byte-size>		FIXME: choose something sane?
 -Wstrict-aliasing			enabled by -Wall
 -Wstrict-aliasing=<0,3>			FIXME: choose something sane?
--Wstrict-overflow=<0,5>			FIXME: choose something sane?
+-Wstrict-overflow			deprecated and slated for removal
+-Wstrict-overflow=<0,5>			deprecated and slated for removal
 -Wstring-compare			enabled by -Wextra
 -Wstringop-overflow			covered by -Wstringop-overflow=2
 -Wstringop-overflow=<0,4>		defaults to 2
diff --git a/doc/manywarnings.texi b/doc/manywarnings.texi
index 76ab0d1a76..27f52c2194 100644
--- a/doc/manywarnings.texi
+++ b/doc/manywarnings.texi
@@ -23,7 +23,6 @@ manywarnings
                                 # dangerous than casting any other value.
    nw="$nw -Winline"            # It's OK to not inline.
    nw="$nw -Wsign-compare"      # Too many false alarms.
-   nw="$nw -Wstrict-overflow"   # It's OK to optimize strictly.
    nw="$nw -Wsystem-headers"    # Don't warn in system headers.
 
    # Setup the list of meaningful warning options for the C compiler.
@@ -64,7 +63,7 @@ manywarnings
 @item
 Start with the newest major release of GCC.
 This will save you time, because some warning options produce many false
-alarms with older versions of GCC (such as @code{-Wstrict-overflow} or
+alarms with older versions of GCC (such as
 @code{-Wunsafe-loop-optimizations}).
 @item
 Consider the platforms commonly used when enabling GCC warnings.
diff --git a/m4/manywarnings-c++.m4 b/m4/manywarnings-c++.m4
index a73f33f245..8c59d21500 100644
--- a/m4/manywarnings-c++.m4
+++ b/m4/manywarnings-c++.m4
@@ -169,7 +169,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC_CXX_IMPL]
     -Wstack-protector \
     -Wstrict-aliasing \
     -Wstrict-null-sentinel \
-    -Wstrict-overflow \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
     -Wsuggest-attribute=noreturn \
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index ea0442d039..536d7d328c 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -133,7 +133,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C
     -Wshadow \
     -Wstack-protector \
     -Wstrict-flex-arrays \
-    -Wstrict-overflow \
     -Wstrict-prototypes \
     -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.