From abd31ec475e6c2654e4cc21188e448e4b6e1fd69d6568c53e5502b2bd8c7eada Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Thu, 27 Jan 2022 19:33:34 +0000 Subject: [PATCH] Accepting request 949525 from home:lee_duncan:branches:network:fcoe - Added upstream commit to fix gcc12 warning/errors: * fcoe-utils-Fix-GCC-12-warning.patch OBS-URL: https://build.opensuse.org/request/show/949525 OBS-URL: https://build.opensuse.org/package/show/network:fcoe/fcoe-utils?expand=0&rev=52 --- fcoe-utils-Fix-GCC-12-warning.patch | 37 +++++++++++++++++++++++++++++ fcoe-utils.changes | 6 +++++ fcoe-utils.spec | 6 +++-- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 fcoe-utils-Fix-GCC-12-warning.patch diff --git a/fcoe-utils-Fix-GCC-12-warning.patch b/fcoe-utils-Fix-GCC-12-warning.patch new file mode 100644 index 0000000..98a1b20 --- /dev/null +++ b/fcoe-utils-Fix-GCC-12-warning.patch @@ -0,0 +1,37 @@ +From f6401524e1be537a78b24aef686968e2b9af7493 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Thu, 27 Jan 2022 14:36:01 +0100 +Subject: [PATCH] Fix GCC 12 warning. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: + inlined from ‘show_full_lun_info’ at fcoeadm_display.c:310:2: +/usr/include/bits/stdio2.h:112:10: error: ‘osname’ may be used uninitialized [-Werror=maybe-uninitialized] + 112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +fcoeadm_display.c: In function ‘show_full_lun_info’: +fcoeadm_display.c:249:15: note: ‘osname’ was declared here + 249 | char *osname; + | ^~~~~~ +--- + fcoeadm_display.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fcoeadm_display.c b/fcoeadm_display.c +index c2ef33b82cfa..3a18138eefd8 100644 +--- a/fcoeadm_display.c ++++ b/fcoeadm_display.c +@@ -246,7 +246,7 @@ static void show_full_lun_info(unsigned int hba, unsigned int port, + char vendor[256]; + char model[256]; + char rev[256]; +- char *osname; ++ char *osname = NULL; + char *capstr; + uint64_t lba = 0; + uint32_t blksize = 0; +-- +2.26.2 + diff --git a/fcoe-utils.changes b/fcoe-utils.changes index 21dbdf4..c82e520 100644 --- a/fcoe-utils.changes +++ b/fcoe-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 27 19:28:40 UTC 2022 - Lee Duncan + +- Added upstream commit to fix gcc12 warning/errors: + * fcoe-utils-Fix-GCC-12-warning.patch + ------------------------------------------------------------------- Fri Oct 15 12:11:45 UTC 2021 - Johannes Segitz diff --git a/fcoe-utils.spec b/fcoe-utils.spec index 148877e..e807081 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,7 +1,7 @@ # # spec file for package fcoe-utils # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -37,7 +37,8 @@ Summary: FCoE userspace management tools License: GPL-2.0-only Group: System/Daemons Source: %{name}-%{version}.tar.xz -Patch0: harden_fcoe.service.patch +Patch0: harden_fcoe.service.patch +Patch1: %{name}-Fix-GCC-12-warning.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %{?systemd_requires} @@ -49,6 +50,7 @@ connections. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build autoreconf -vi