]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime: Silence gcc warning.
authorBruno Haible <bruno@clisp.org>
Thu, 18 May 2023 20:46:47 +0000 (22:46 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 May 2023 21:32:32 +0000 (23:32 +0200)
* lib/nstrftime.c: Add #pragma GCC diagnostic.

ChangeLog
lib/nstrftime.c

index c32b7f5b639578e9b069697ce9c2b0e40294a2e2..67100daa91877119222daba209a28e202a46f817 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-05-18  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime: Silence gcc warning.
+       * lib/nstrftime.c: Add #pragma GCC diagnostic.
+
 2023-05-18  Bruno Haible  <bruno@clisp.org>
 
        astrxfrm: Silence gcc warning.
index 2a1dd8d88d7606c08dbb633a2accda52f5acd3d1..869c97f67db0816efda55f9a0eccd41ae3e5fafd 100644 (file)
@@ -276,6 +276,14 @@ extern char *tzname[];
    more reliable way to accept other sets of digits.  */
 #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
 
+/* Avoid false GCC warning "'memset' specified size 18446744073709551615 exceeds
+   maximum object size 9223372036854775807", caused by insufficient data flow
+   analysis and value propagation of the 'width_add' expansion when GCC is not
+   optimizing.  Cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443>.  */
+#if __GNUC__ >= 7 && !__OPTIMIZE__
+# pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
 #if FPRINTFTIME
 static void
 fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len)