From decdd868ba0d3d2294dd077a2484c758382ca7d7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 24 Jun 2018 11:51:48 -0700 Subject: [PATCH] canon-host.c: avoid spurious GCC 9 warning * lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc. --- ChangeLog | 3 +++ lib/canon-host.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 232f732ed8..1a7110935c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-06-24 Jim Meyering + canon-host.c: avoid spurious GCC 9 warning + * lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc. + manywarnings: accommodate GCC 9.0-pre: remove -Wchkp and -Wabi * build-aux/gcc-warning.spec: Add them here, each with an explanation. * m4/manywarnings.m4: Remove them. diff --git a/lib/canon-host.c b/lib/canon-host.c index f2a16a7584..64afe1a0a1 100644 --- a/lib/canon-host.c +++ b/lib/canon-host.c @@ -17,6 +17,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* Without this pragma, gcc version 9.0.0 20180616 suggests that + the canon_* functions might be candidateifor attribute 'malloc' */ +#if 9 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" +#endif + #include #include "canon-host.h" -- 2.39.5