]> Savannah Git Hosting - gnulib.git/commitdiff
canon-host.c: avoid spurious GCC 9 warning
authorJim Meyering <meyering@fb.com>
Sun, 24 Jun 2018 18:51:48 +0000 (11:51 -0700)
committerJim Meyering <meyering@fb.com>
Sun, 24 Jun 2018 23:10:54 +0000 (16:10 -0700)
* lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc.

ChangeLog
lib/canon-host.c

index 232f732ed8548cbcaee91f480000f0710703eeed..1a7110935c0630552427fbc56ab9f7cc5131a46c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2018-06-24  Jim Meyering  <meyering@fb.com>
 
+       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.
index f2a16a75847ea89b03821344e1d214f60a23deff..64afe1a0a1d36af646fc6560831bb3d20e2db1b0 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* 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 <config.h>
 
 #include "canon-host.h"