Fix FTBFS in test/teststr.c with GCC 8 (#1539844)

This commit is contained in:
Florian Weimer 2018-01-29 19:00:24 +01:00
parent 9b5ebc0bbd
commit 47bc586a89
2 changed files with 26 additions and 1 deletions

20
apr-rh1539844.patch Normal file
View File

@ -0,0 +1,20 @@
diff -ur apr-1.6.3.orig/test/teststr.c apr-1.6.3/test/teststr.c
--- apr-1.6.3.orig/test/teststr.c 2016-03-03 17:11:16.000000000 +0100
+++ apr-1.6.3/test/teststr.c 2018-01-29 18:54:44.748931098 +0100
@@ -307,10 +307,15 @@
for (; off < 999999999; off += 999) {
apr_strfsize(off, buf);
}
- for (off = 1; off < LONG_MAX && off > 0; off *= 2) {
+
+ off = 1;
+ while (1) {
apr_strfsize(off, buf);
apr_strfsize(off + 1, buf);
apr_strfsize(off - 1, buf);
+ if (off > LONG_MAX / 2)
+ break;
+ off *= 2;
}
ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '$');

View File

@ -6,7 +6,7 @@
Summary: Apache Portable Runtime library
Name: apr
Version: 1.6.3
Release: 3%{?dist}
Release: 4%{?dist}
# ASL 2.0: everything
# ISC: network_io/apr-1.4.6/network_io/unix/inet_?to?.c
# BSD with advertising: strings/apr_snprintf.c, strings/apr_fnmatch.c,
@ -21,6 +21,7 @@ Source1: apr-wrapper.h
Patch2: apr-1.2.2-locktimeout.patch
Patch3: apr-1.2.2-libdir.patch
Patch4: apr-1.2.7-pkgconf.patch
Patch5: apr-rh1539844.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: autoconf, libtool, libuuid-devel, python
# To enable SCTP support
@ -49,6 +50,7 @@ C data structures and routines.
%patch2 -p1 -b .locktimeout
%patch3 -p1 -b .libdir
%patch4 -p1 -b .pkgconf
%patch5 -p1 -b .rh1539844
%build
# regenerate configure script etc.
@ -133,6 +135,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/aclocal/*.m4
%changelog
* Mon Jan 29 2018 Florian Weimer <fweimer@redhat.com> - 1.6.3-4
- Fix FTBFS in test/teststr.c with GCC 8 (#1539844)
* Mon Jan 29 2018 Florian Weimer <fweimer@redhat.com> - 1.6.3-3
- Rebuild with new redhat-rpm-config build flags