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

ChangeLog
lib/vasnprintf.c

index 67100daa91877119222daba209a28e202a46f817..50a9cef230f4c996ac9e82d07968fef87cbc5a45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-05-18  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf, c-vasnprintf: Silence gcc warning.
+       * lib/vasnprintf.c: Add #pragma GCC diagnostic.
+
 2023-05-18  Bruno Haible  <bruno@clisp.org>
 
        nstrftime: Silence gcc warning.
index 007d28098052d0dc17586baa6aaca0b89220d55e..63a6cd60f3571fc2e9bbefa6e014b2451f5d2095 100644 (file)
@@ -927,6 +927,14 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
   return roomptr;
 }
 
+/* Avoid pointless GCC warning "argument 1 value '18446744073709551615' exceeds
+   maximum object size 9223372036854775807", triggered by the use of xsum as
+   argument of malloc.  */
+# if __GNUC__ >= 7
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Walloc-size-larger-than="
+# endif
+
 /* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
    representation.
    Destroys the contents of a.
@@ -983,6 +991,10 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
   return c_ptr;
 }
 
+# if __GNUC__ >= 7
+#  pragma GCC diagnostic pop
+# endif
+
 # if NEED_PRINTF_LONG_DOUBLE
 
 /* Assuming x is finite and >= 0: