Work around false positive gcc-11 diagnostic

This commit is contained in:
Jeff Law 2020-08-19 10:22:25 -06:00
parent d70a179e53
commit d8981421df
2 changed files with 21 additions and 1 deletions

15
libblockdev-gcc11.patch Normal file
View File

@ -0,0 +1,15 @@
diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c
index a2908ec..97abd3b 100644
--- a/src/plugins/kbd.c
+++ b/src/plugins/kbd.c
@@ -732,6 +732,10 @@ static gboolean wait_for_file (const char *filename) {
*
* Tech category: %BD_KBD_TECH_BCACHE-%BD_KBD_TECH_MODE_CREATE
*/
+/* This triggers a known false positive warning in gcc-11. It's being
+ addressed upstream, but until the fix is available, this works around
+ the false positive. */
+__attribute__ ((optimize ("-O1")))
gboolean bd_kbd_bcache_create (const gchar *backing_device, const gchar *cache_device, const BDExtraArg **extra, const gchar **bcache_device, GError **error) {
const gchar *argv[6] = {"make-bcache", "-B", backing_device, "-C", cache_device, NULL};
gboolean success = FALSE;

View File

@ -125,11 +125,12 @@
Name: libblockdev
Version: 2.24
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A library for low-level manipulation with block devices
License: LGPLv2+
URL: https://github.com/storaged-project/libblockdev
Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
Patch0: libblockdev-gcc11.patch
BuildRequires: glib2-devel
%if %{with_gi}
@ -680,6 +681,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%build
autoreconf -ivf
@ -983,6 +985,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%files plugins-all
%changelog
* Wed Aug 19 2020 Jeff Law <law@redhat.com> - 2.24-4
- Work around gcc-11 false positive warning
* Mon Jul 27 2020 Hans de Goede <hdegoede@redhat.com> - 2.24-3
- Change -mpath subpackage Requires: device-mapper-multipath into Recommends
- Related: rhbz#1857393