From 1e805ec6186c74273d6032c87afd4539917afc05 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 27 Apr 2023 12:51:09 +0200 Subject: [PATCH] Port configure script to C99 Related to: --- pinfo-configure-c99.patch | 38 ++++++++++++++++++++++++++++++++++++++ pinfo.spec | 6 +++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 pinfo-configure-c99.patch diff --git a/pinfo-configure-c99.patch b/pinfo-configure-c99.patch new file mode 100644 index 0000000..6a7661e --- /dev/null +++ b/pinfo-configure-c99.patch @@ -0,0 +1,38 @@ +Defining _XOPEN_SOURCE on its own hides definitions in other headers +(which is already mentioned in upstream commit f49941a). One way to +deal with this is to define _DEFAULT_SOURCE in addition to +_XOPEN_SOURCE, which is what this commit implements. + +This is one way to avoid an implicit function declaration in the +built-in mmap test that autoconf provides. It includes and +expects that to provide a declaration of getpagesize because the +earlier check for HAVE_GETPAGESIZE succeeded. Without addressing the +implicit function declaration, the outcome of this check will change +with future compilers which no longer support them by default. + +Submitted upstream: + + +diff --git a/macros/wchar.m4 b/macros/wchar.m4 +index 2dc3d3a940f6c6fd..a7d6e967024df594 100644 +--- a/macros/wchar.m4 ++++ b/macros/wchar.m4 +@@ -78,7 +78,8 @@ AC_DEFUN([AC_CHECK_WCHAR],[ + then + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( +- [[ ++ [[ ++ #define _DEFAULT_SOURCE + #define _XOPEN_SOURCE 600 + #include + ]], +@@ -87,7 +88,7 @@ AC_DEFUN([AC_CHECK_WCHAR],[ + [ + dnl if found, set variables and print result + have_wcwidth=true +- wchar_flags="$wchar_flags -D_XOPEN_SOURCE=600" ++ wchar_flags="$wchar_flags -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600" + AC_MSG_RESULT([with -D_XOPEN_SOURCE=600]) + ], + [ ] diff --git a/pinfo.spec b/pinfo.spec index bdae569..f98a1a0 100644 --- a/pinfo.spec +++ b/pinfo.spec @@ -1,6 +1,6 @@ Name: pinfo Version: 0.6.13 -Release: 2%{?dist} +Release: 3%{?dist} Summary: An info file viewer License: GPL-2.0-only @@ -14,6 +14,7 @@ Patch4: pinfo-0.6.13-fnocommon.patch Patch5: pinfo-0.6.13-gccwarn.patch Patch6: pinfo-0.6.13-nogroup.patch Patch7: pinfo-0.6.13-stringop-overflow.patch +Patch8: pinfo-configure-c99.patch BuildRequires: automake BuildRequires: gcc @@ -55,6 +56,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/pinfo.1* %changelog +* Thu Apr 27 2023 Florian Weimer - 0.6.13-3 +- Port configure script to C99 + * Tue Mar 14 2023 Lukáš Zaoral - 0.6.13-2 - migrated to SPDX license - cleaned-up the specfile