From 59005b486cb4b0e422cc2a2ef7623931b0af6660 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 12 Jul 2020 23:56:29 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/mini-gmp-gnulib.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b58fa7796..ac0d8f3e53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-07-12 Bruno Haible + + 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 libgmp: Link to the correct shared library. diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c index 5019be5d52..e9e8a174c0 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__) -- 2.39.5