diff --git a/privoxy-configure-c99.patch b/privoxy-configure-c99.patch
new file mode 100644
index 0000000..bff1f67
--- /dev/null
+++ b/privoxy-configure-c99.patch
@@ -0,0 +1,36 @@
+Fix argument types in gmtime_r, localtime_r probes. Otherwise these
+probes always fail with stricter compilers even if there is C library
+support for these functions.
+
+Submitted upstream:
+
+diff --git a/configure.in b/configure.in
+index 9073fe97632b23ba..04a8d1e70af78ae5 100644
+--- a/configure.in
++++ b/configure.in
+@@ -615,9 +615,9 @@ AC_CHECK_FUNC(gmtime_r, [
+ AC_TRY_COMPILE([
+ # include
+ ], [
+- struct time *t;
+- struct tm *tm;
+- (void) gmtime_r(t, tm)
++ struct time t;
++ struct tm tm;
++ (void) gmtime_r(&t, &tm)
+ ], [
+ AC_MSG_RESULT(ok)
+ AC_DEFINE(HAVE_GMTIME_R)
+@@ -633,9 +633,9 @@ AC_CHECK_FUNC(localtime_r, [
+ AC_TRY_COMPILE([
+ # include
+ ], [
+- struct time *t;
+- struct tm *tm;
+- (void) localtime_r(t, tm)
++ struct time t;
++ struct tm tm;
++ (void) localtime_r(&t, &tm)
+ ], [
+ AC_MSG_RESULT(ok)
+ AC_DEFINE(HAVE_LOCALTIME_R)
diff --git a/privoxy.spec b/privoxy.spec
index da61cea..18ce126 100644
--- a/privoxy.spec
+++ b/privoxy.spec
@@ -7,7 +7,7 @@
Name: privoxy
Version: 3.0.34
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Privacy enhancing proxy
License: GPL-2.0-or-later
Source0: http://downloads.sourceforge.net/ijbswa/%{name}-%{version}-%{beta_or_stable}-src.tar.gz
@@ -16,6 +16,7 @@ Source2: privoxy.logrotate
Patch0: 53748ca8ca3c893025be34dd4f104546fcbd0602.patch
Patch1: e73b93ea9ad1f3e980bd78ed3ebf65dedbb598a2.patch
Patch2: 87253c999d5628a6e9287bb0cc613d7b44bcec09.patch
+Patch3: privoxy-configure-c99.patch
URL: http://www.privoxy.org/
Requires(pre): shadow-utils
BuildRequires: make
@@ -37,6 +38,7 @@ Privoxy is based on the Internet Junkbuster.
%patch -P 0 -p 1
%patch -P 1 -p 1
%patch -P 2 -p 1
+%patch -P 3 -p 1
%build
rm -rf autom4te.cache
@@ -110,6 +112,9 @@ fi
%doc doc
%changelog
+* Mon Dec 18 2023 Florian Weimer - 3.0.34-6
+- Fix C compatibility issue in configure script
+
* Mon Aug 28 2023 Gwyn Ciesla - 3.0.34-5
- Additional pcre2 patches from upstream.