Hello community,

here is the log from the commit of package ipxe for openSUSE:Factory checked in 
at 2018-06-20 15:29:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ipxe (Old)
 and      /work/SRC/openSUSE:Factory/.ipxe.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ipxe"

Wed Jun 20 15:29:57 2018 rev:2 rq:617506 version:1.0.0+git20180203.546dd51d

Changes:
--------
--- /work/SRC/openSUSE:Factory/ipxe/ipxe.changes        2018-02-22 
15:01:05.516926631 +0100
+++ /work/SRC/openSUSE:Factory/.ipxe.new/ipxe.changes   2018-06-20 
15:31:07.886567146 +0200
@@ -1,0 +2,5 @@
+Mon Jun 18 12:58:11 UTC 2018 - bwiedem...@suse.com
+
+- Add ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch (boo#1090355)
+
+-------------------------------------------------------------------

New:
----
  ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ipxe.spec ++++++
--- /var/tmp/diff_new_pack.bCpZOy/_old  2018-06-20 15:31:09.006526512 +0200
+++ /var/tmp/diff_new_pack.bCpZOy/_new  2018-06-20 15:31:09.010526367 +0200
@@ -24,6 +24,7 @@
 Group:          System/Boot
 Url:            http://ipxe.org/
 Source:         %{name}-%{version}.tar.gz
+Patch0:         ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch
 BuildRequires:  binutils-devel
 BuildRequires:  /usr/bin/mkisofs
 BuildRequires:  perl
@@ -54,6 +55,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 cd src

++++++ ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch ++++++
>From cd6ca646c12371f0146d43ea5a6b7574342c2a7f Mon Sep 17 00:00:00 2001
From: Bruce Rogers <brog...@suse.com>
Date: Wed, 25 Apr 2018 10:26:28 -0600
Subject: [PATCH] [efi] guard strncpy with gcc warning ignore pragma

Using gcc 8 with the -Wstringop-truncation option, and with warnings
treated as errors, the following error is emitted:

util/elf2efi.c:494:2: error: 'strncpy' specified bound 8 equals destination
size [-Werror=stringop-truncation]
  strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) );
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Use gcc pragmas surrounding this line of code which avoid this warning. The
strncpy usage here is correct.

[BR: BSC#1090355]
Signed-off-by: Bruce Rogers <brog...@suse.com>
---
 src/util/elf2efi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c
index 6718df77..93cdda03 100644
--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -494,7 +494,13 @@ static struct pe_section * process_section ( struct 
elf_file *elf,
        memset ( new, 0, sizeof ( *new ) + section_filesz );
 
        /* Fill in section header details */
+/* gcc 8 warning gives false positive here - our usage is correct */
+#pragma GCC diagnostic push
+#if __GNUC__ >= 8
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
        strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) );
+#pragma GCC diagnostic pop
        new->hdr.Misc.VirtualSize = section_memsz;
        new->hdr.VirtualAddress = shdr->sh_addr;
        new->hdr.SizeOfRawData = section_filesz;
-- 
2.16.3


Reply via email to