Use DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION to silence GCC 8.1
[deliverable/binutils-gdb.git] / bfd / elf64-s390.c
index 612557fa74ff300307200a51c1ff940d5947151c..93a3c7c22aca63b747a5ca596d1096d1dc2a5c72 100644 (file)
@@ -3760,7 +3760,16 @@ elf_s390_write_core_note (bfd *abfd, char *buf, int *bufsiz,
        va_end (ap);
 
        strncpy (data + 40, fname, 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 + 56, psargs, 80);
+       DIAGNOSTIC_POP;
        return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
                                   &data, sizeof (data));
       }
This page took 0.02366 seconds and 4 git commands to generate.