Fix FTBFS with gcc-12.

This commit is contained in:
Adam Borowski 2022-01-27 12:31:17 +01:00
parent ae612e27af
commit 81872609a0
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From ed81a44e6faffd450d9ab779a7c5862a9bd7c773 Mon Sep 17 00:00:00 2001
From: Adam Borowski <kilobyte@angband.pl>
Date: Thu, 27 Jan 2022 12:08:56 +0100
Subject: [PATCH] test: don't print the address of a FILE after fclose
In pre-release gcc-12 that Fedora releases with, it triggers
-Werror=use-after-free despite us not dereferencing the pointer.
Its address is no longer useful for debugging anyway.
---
src/test/unittest/ut_file.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/test/unittest/ut_file.c b/src/test/unittest/ut_file.c
index 26f5cbda6..266b86387 100644
--- a/src/test/unittest/ut_file.c
+++ b/src/test/unittest/ut_file.c
@@ -88,10 +88,8 @@ ut_fclose(const char *file, int line, const char *func, FILE *stream)
{
int retval = os_fclose(stream);
- if (retval != 0) {
- ut_fatal(file, line, func, "!fclose: 0x%llx",
- (unsigned long long)stream);
- }
+ if (retval != 0)
+ ut_fatal(file, line, func, "!fclose");
return retval;
}
--
2.34.1

View File

@ -32,12 +32,13 @@
Name: nvml
Version: 1.11.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Persistent Memory Development Kit (formerly NVML)
License: BSD
URL: http://pmem.io/pmdk
Source0: https://github.com/pmem/pmdk/releases/download/%{upstreamversion}/pmdk-%{upstreamversion}.tar.gz
Patch0: 0001-test-don-t-print-the-address-of-a-FILE-after-fclose.patch
BuildRequires: gcc
@ -591,6 +592,7 @@ provided in the command line options to check whether files are in a consistent
%prep
%setup -q -n pmdk-%{upstreamversion}
%patch0 -p1
%build
@ -676,6 +678,9 @@ cp utils/pmdk.magic %{buildroot}%{_datadir}/pmdk/
%changelog
* Thu Jan 27 2022 Adam Borowski <kilobyte@angband.pl> - 1.11.1-3
- Fix FTBFS with gcc-12.
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild