[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libgmp: Avoid warning when --without-libgmp is used
From: |
Bruno Haible |
Subject: |
libgmp: Avoid warning when --without-libgmp is used |
Date: |
Sun, 12 Jul 2020 23:57:10 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) |
After creating a testdir of module libgmp
./gnulib-tool --create-testdir --dir=/tmp/testdir --single-configure libgmp
and configuring it with --without-libgmp, I get a GCC warning:
gcc -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -g -O2 -MT
mini-gmp-gnulib.o -MD -MP -MF .deps/mini-gmp-gnulib.Tpo -c -o mini-gmp-gnulib.o
mini-gmp-gnulib.c
mini-gmp-gnulib.c:28:10: warning: unknown option after ‘#pragma GCC diagnostic’
kind [-Wpragmas]
# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc"
^
GCC 8 is the first version that supports
'# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc"'.
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.
diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c
index 5019be5..e9e8a17 100644
--- a/lib/mini-gmp-gnulib.c
+++ b/lib/mini-gmp-gnulib.c
@@ -22,12 +22,14 @@
#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__)
- [PATCH] libgmp: new module, Paul Eggert, 2020/07/06
- Re: [PATCH] libgmp: new module, Bruno Haible, 2020/07/12
- libgmp tests: Add some safety checks, Bruno Haible, 2020/07/12
- libgmp: link to the correct shared library, Bruno Haible, 2020/07/12
- Re: libgmp: link to the correct shared library, Paul Eggert, 2020/07/23
- Re: libgmp: link to the correct shared library, Bruno Haible, 2020/07/23
- Re: libgmp: link to the correct shared library, Paul Eggert, 2020/07/23
- Re: libgmp: link to the correct shared library, Bruno Haible, 2020/07/23
- Re: libgmp: link to the correct shared library, Paul Eggert, 2020/07/26
- Re: libgmp: link to the correct shared library, Paul Eggert, 2020/07/26
libgmp: Avoid warning when --without-libgmp is used,
Bruno Haible <=