From fadb60f99b2f6692944d0c70dde70bd103577fa7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 15 Nov 2023 20:32:47 +0100 Subject: [PATCH] Backport upstream patch for C99 compatibility issue --- cpio-configure-c99.patch | 40 ++++++++++++++++++++++++++++++++++++++++ cpio.spec | 6 +++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 cpio-configure-c99.patch diff --git a/cpio-configure-c99.patch b/cpio-configure-c99.patch new file mode 100644 index 0000000..2327888 --- /dev/null +++ b/cpio-configure-c99.patch @@ -0,0 +1,40 @@ +commit 8179be21e664cedb2e9d238cc2f6d04965e97275 +Author: Sergey Poznyakoff +Date: Thu May 11 10:18:44 2023 +0300 + + configure: Include needed header for major/minor macros + + This helps in avoiding the warning about implicit function declaration + which is elevated as error with newer compilers e.g. clang 16 + + Signed-off-by: Khem Raj + +diff --git a/configure.ac b/configure.ac +index de479e7454e5d035..c60102972282b63b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -43,8 +43,22 @@ AC_TYPE_UID_T + AC_CHECK_TYPE(gid_t, int) + + AC_HEADER_DIRENT +-AX_COMPILE_CHECK_RETTYPE([major], [0]) +-AX_COMPILE_CHECK_RETTYPE([minor], [0]) ++AX_COMPILE_CHECK_RETTYPE([major], [0], [ ++#include ++#ifdef MAJOR_IN_MKDEV ++# include ++#endif ++#ifdef MAJOR_IN_SYSMACROS ++# include ++#endif]) ++AX_COMPILE_CHECK_RETTYPE([minor], [0], [ ++#include ++#ifdef MAJOR_IN_MKDEV ++# include ++#endif ++#ifdef MAJOR_IN_SYSMACROS ++# include ++#endif]) + + AC_CHECK_FUNCS([fchmod fchown]) + # This is needed for mingw build diff --git a/cpio.spec b/cpio.spec index 172944e..2b78709 100644 --- a/cpio.spec +++ b/cpio.spec @@ -1,7 +1,7 @@ Summary: A GNU archiving program Name: cpio Version: 2.14 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL-3.0-or-later URL: https://www.gnu.org/software/cpio/ Source0: https://ftp.gnu.org/gnu/cpio/cpio-%{version}.tar.bz2 @@ -45,6 +45,7 @@ Patch8: cpio-2.11-crc-fips-nit.patch # Upstream patch # https://www.mail-archive.com/bug-cpio@gnu.org/msg00605.html Patch11: cpio-2.14-restore-access-and-modification-times-of-symlinks.patch +Patch12: cpio-configure-c99.patch Provides: bundled(gnulib) Provides: bundled(paxutils) @@ -109,6 +110,9 @@ make check || { %{_infodir}/*.info* %changelog +* Wed Nov 15 2023 Florian Weimer - 2.14-5 +- Backport upstream patch for C99 compatibility issue + * Wed Jul 19 2023 Fedora Release Engineering - 2.14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild