coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nstrftime.c fails to build due to memset overflow


From: Paul Eggert
Subject: Re: nstrftime.c fails to build due to memset overflow
Date: Thu, 18 May 2023 14:43:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

--- a/configure.ac
+++ b/configure.ac
@@ -261,6 +261,11 @@ if test $gl_gcc_warnings != no; then
   # FP in careadlinkat.c w/gcc 10.0.1 20200205
   gl_WARN_ADD([-Wno-return-local-addr])
+ # FIXME: remove this line when gcc improves
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
+  # FP wth -O0 in nstrftime.c w/gcc 12, and 13 at least
+  gl_WARN_ADD([-Wno-stringop-overflow])

This patch doesn't look right either. First, <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443> is a meta-bug report, and so is too vague for anybody to see what problem the FIXME is referring to. The FIXME should refer to a specific GCC bug report, and if no such bug report exists one should be created.

Second, if the bug occurs with -O0 but not with -O2, then gl_WARN_ADD should be invoked only if -O0 is specified. -Wstringop-overflow is a useful option and should not be suppressed for ordinary (-O2) builds simply because there's a problem in -O0 builds.

More generally, I don't think we should spend much time worrying about configuring with --enable-gcc-warnings and compiling with -O0. With today's GCC it's better to say, "don't do that". That is, either configure with a high quality of static checking, with --enable-gcc-warnings; or configure with easy-to-debug options like CFLAGS="-O0". The current GCC can't do both well, and there's little sense making application code less reliable in order to try to make GCC do a little bit better for this poorly-supported combination.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]