]> Savannah Git Hosting - gnulib.git/commitdiff
libgmp: Avoid warning when --without-libgmp is used.
authorBruno Haible <bruno@clisp.org>
Sun, 12 Jul 2020 21:56:29 +0000 (23:56 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 12 Jul 2020 21:56:29 +0000 (23:56 +0200)
* lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
GCC >= 8, not for GCC >= 4.6.

ChangeLog
lib/mini-gmp-gnulib.c

index 2b58fa7796b51041873732264f20bff59afa17d5..ac0d8f3e53fe39084559c732e30ac509335996aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-07-12  Bruno Haible  <bruno@clisp.org>
+
+       libgmp: Avoid warning when --without-libgmp is used.
+       * lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
+       GCC >= 8, not for GCC >= 4.6.
+
 2020-07-12  Bruno Haible  <bruno@clisp.org>
 
        libgmp: Link to the correct shared library.
index 5019be5d52a07f7521cb4584e97444d099574535..e9e8a174c0388cb9e3c7834d29d6027568861382 100644 (file)
 
 #include "mini-gmp.h"
 
-/* Pacify GCC -Wsuggest-attribute=const, malloc, pure.  */
+/* Pacify GCC -Wsuggest-attribute=const, pure, malloc.  */
 #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
-# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc"
 # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
 #endif
+#if 8 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc"
+#endif
 
 /* Pacify GCC -Wunused-variable for variables used only in 'assert' calls.  */
 #if defined NDEBUG && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)