Use DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION to silence GCC 8.1
[deliverable/binutils-gdb.git] / bfd / elf32-ppc.c
index 3482baca2051dbb98f42de21d5369655133a2661..ea8dbed9819d8dcb461091e6d00becc07fa320f6 100644 (file)
@@ -2411,7 +2411,16 @@ ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...)
        va_start (ap, note_type);
        memset (data, 0, sizeof (data));
        strncpy (data + 32, va_arg (ap, const char *), 16);
+       DIAGNOSTIC_PUSH;
+       /* GCC 8.1 warns about 80 equals destination size with
+          -Wstringop-truncation:
+          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+        */
+#if GCC_VERSION == 8001
+       DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
        strncpy (data + 48, va_arg (ap, const char *), 80);
+       DIAGNOSTIC_POP;
        va_end (ap);
        return elfcore_write_note (abfd, buf, bufsiz,
                                   "CORE", note_type, data, sizeof (data));
This page took 0.025423 seconds and 4 git commands to generate.