Revert bfd part of "Silence gcc-8 warnings"
authorAlan Modra <amodra@gmail.com>
Mon, 23 Apr 2018 14:17:22 +0000 (23:47 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 23 Apr 2018 14:20:13 +0000 (23:50 +0930)
The gcc warning has been fixed, and the patch regressed builds with
some older versions of gcc.

* elf-linux-core.h: Revert last change.
* elf.c: Likewise.

bfd/ChangeLog
bfd/elf-linux-core.h
bfd/elf.c

index e8b748b..3c26f8a 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-23  Alan Modra  <amodra@gmail.com>
+
+       * elf-linux-core.h: Revert last change.
+       * elf.c: Likewise.
+
 2018-04-23  Nick Clifton  <nickc@redhat.com>
 
        PR 23056
index 25d33f6..0a5d76f 100644 (file)
@@ -69,12 +69,8 @@ swap_linux_prpsinfo32_ugid32_out
   bfd_put_32 (obfd, from->pr_ppid, to->pr_ppid);
   bfd_put_32 (obfd, from->pr_pgrp, to->pr_pgrp);
   bfd_put_32 (obfd, from->pr_sid, to->pr_sid);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas"
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
   strncpy (to->pr_fname, from->pr_fname, sizeof (to->pr_fname));
   strncpy (to->pr_psargs, from->pr_psargs, sizeof (to->pr_psargs));
-#pragma GCC diagnostic pop
 }
 
 /* External 32-bit structure for PRPSINFO.  This structure is
@@ -125,12 +121,8 @@ swap_linux_prpsinfo32_ugid16_out
   bfd_put_32 (obfd, from->pr_ppid, to->pr_ppid);
   bfd_put_32 (obfd, from->pr_pgrp, to->pr_pgrp);
   bfd_put_32 (obfd, from->pr_sid, to->pr_sid);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas"
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
   strncpy (to->pr_fname, from->pr_fname, sizeof (to->pr_fname));
   strncpy (to->pr_psargs, from->pr_psargs, sizeof (to->pr_psargs));
-#pragma GCC diagnostic pop
 }
 
 /* External 64-bit structure for PRPSINFO.  This structure is
@@ -182,12 +174,8 @@ swap_linux_prpsinfo64_ugid32_out
   bfd_put_32 (obfd, from->pr_ppid, to->pr_ppid);
   bfd_put_32 (obfd, from->pr_pgrp, to->pr_pgrp);
   bfd_put_32 (obfd, from->pr_sid, to->pr_sid);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas"
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
   strncpy (to->pr_fname, from->pr_fname, sizeof (to->pr_fname));
   strncpy (to->pr_psargs, from->pr_psargs, sizeof (to->pr_psargs));
-#pragma GCC diagnostic pop
 }
 
 /* External 64-bit structure for PRPSINFO.  This structure is
@@ -239,12 +227,8 @@ swap_linux_prpsinfo64_ugid16_out
   bfd_put_32 (obfd, from->pr_ppid, to->pr_ppid);
   bfd_put_32 (obfd, from->pr_pgrp, to->pr_pgrp);
   bfd_put_32 (obfd, from->pr_sid, to->pr_sid);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas"
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
   strncpy (to->pr_fname, from->pr_fname, sizeof (to->pr_fname));
   strncpy (to->pr_psargs, from->pr_psargs, sizeof (to->pr_psargs));
-#pragma GCC diagnostic pop
 }
 
 #endif
index b4549ea..8ea5a81 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -10549,12 +10549,8 @@ elfcore_write_prpsinfo (bfd  *abfd,
 #endif
 
       memset (&data, 0, sizeof (data));
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas"
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
       strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
       strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
-#pragma GCC diagnostic pop
       return elfcore_write_note (abfd, buf, bufsiz,
                                 "CORE", note_type, &data, sizeof (data));
     }