[binutils-gdb] S/390: Suppress string diagnostics for pre-release GCC

Andreas Krebbel krebbel@sourceware.org
Mon Jul 23 08:49:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=898ade12ee835c3a55460ae4fe311f40a01cf586

commit 898ade12ee835c3a55460ae4fe311f40a01cf586
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Mon Jul 23 10:29:37 2018 +0200

    S/390: Suppress string diagnostics for pre-release GCC
    
    Building for S/390 currently fails when using a GCC 8.1 pre-release
    version like 8.0.1 (as it is used by F28).  Fixed with the attached patch.
    
    bfd/ChangeLog:
    
    2018-07-23  Andreas Krebbel  <krebbel@linux.ibm.com>
    
    	* elf32-s390.c (elf_s390_write_core_note): Make GCC version 8.0 to
    	be covered by the check as well.
    	* elf64-s390.c (elf_s390_write_core_note): Likewise.

Diff:
---
 bfd/elf32-s390.c | 4 ++--
 bfd/elf64-s390.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 56008a1..c47bbab 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -3951,7 +3951,7 @@ elf_s390_write_core_note (bfd *abfd, char *buf, int *bufsiz,
 	va_end (ap);
 
 	strncpy (data + 28, fname, 16);
-#if GCC_VERSION == 8001
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
 	DIAGNOSTIC_PUSH;
 	/* GCC 8.1 warns about 80 equals destination size with
 	   -Wstringop-truncation:
@@ -3960,7 +3960,7 @@ elf_s390_write_core_note (bfd *abfd, char *buf, int *bufsiz,
 	DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
 #endif
 	strncpy (data + 44, psargs, 80);
-#if GCC_VERSION == 8001
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
 	DIAGNOSTIC_POP;
 #endif
 	return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 0a9bfe4..16a62a3 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -3785,7 +3785,7 @@ elf_s390_write_core_note (bfd *abfd, char *buf, int *bufsiz,
 	va_end (ap);
 
 	strncpy (data + 40, fname, 16);
-#if GCC_VERSION == 8001
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
 	DIAGNOSTIC_PUSH;
 	/* GCC 8.1 warns about 80 equals destination size with
 	   -Wstringop-truncation:
@@ -3794,7 +3794,7 @@ elf_s390_write_core_note (bfd *abfd, char *buf, int *bufsiz,
 	DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
 #endif
 	strncpy (data + 56, psargs, 80);
-#if GCC_VERSION == 8001
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
 	DIAGNOSTIC_POP;
 #endif
 	return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,



More information about the Binutils-cvs mailing list