From c77e9d991e93ed8bfacd17ef5b6613d5e7231b6b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 27 Nov 2023 14:58:49 +0100 Subject: [PATCH] Backport upstream patch to fix another C99 issue in configure Related to: --- radvd-configure-c99.patch | 47 +++++++++++++++++++++++++++++++++++++++ radvd.spec | 6 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 radvd-configure-c99.patch diff --git a/radvd-configure-c99.patch b/radvd-configure-c99.patch new file mode 100644 index 0000000..e7e2cfe --- /dev/null +++ b/radvd-configure-c99.patch @@ -0,0 +1,47 @@ +commit 5acb1c64766dfaf37c9745632f99feecf11d1403 +Author: Sam James +Date: Fri Feb 3 02:33:13 2023 +0000 + + configure.ac: Fix -Wint-conversion warnings + + These become fatal with Clang 15 and may lead to incorrect configure + test results. + + ``` + -ignoreme: warning: incompatible pointer to integer conversion initializing 'int' with an expression of type 'uint16_t[8]' (aka 'unsigned short[8]') [-Wint-conversion] + +ignoreme: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'uint16_t[8]' (aka 'unsigned short[8]') [-Wint-conversion] + int u = in6_u.s6_addr16; + ^ ~~~~~~~~~~~~~~~ + ``` + + Signed-off-by: Sam James + +diff --git a/configure.ac b/configure.ac +index 23c21e7b4abedca1..a3976b605fa096e9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -174,15 +174,19 @@ AC_HEADER_TIME + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_MSG_CHECKING(whether struct sockaddr_in6 has sin6_scope_id) +-AC_TRY_COMPILE([#include +-#include ], [static struct sockaddr_in6 ac_sin6; int ac_size = +-sizeof (ac_sin6.sin6_scope_id);], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_SIN6_SCOPE_ID], ++AC_TRY_COMPILE([#include ++#include ++#include ], [ ++static struct sockaddr_in6 ac_sin6; ++uint32_t ac_size = sizeof (ac_sin6.sin6_scope_id); ++], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_SIN6_SCOPE_ID], + 1, [whether struct sockaddr_in6 has sin6_scope_id])], + AC_MSG_RESULT(no)) + + AC_MSG_CHECKING(whether struct in6_addr has u6_addrXX and defines s6_addrXX) +-AC_TRY_COMPILE([#include ], [static struct in6_addr in6_u; +-int u = in6_u.s6_addr16;], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_IN6_ADDR_S6_ADDR], ++AC_TRY_COMPILE([#include ++#include ], [static struct in6_addr in6_u; ++uint16_t u = in6_u.s6_addr16[0];], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_IN6_ADDR_S6_ADDR], + 1, [whether struct in6_addr has u6_addrXX and defines s6_addrXX])], + AC_MSG_RESULT(no)) + diff --git a/radvd.spec b/radvd.spec index ea89ad9..0511ff5 100644 --- a/radvd.spec +++ b/radvd.spec @@ -1,7 +1,7 @@ Summary: A Router Advertisement daemon Name: radvd Version: 2.19 -Release: 10%{?dist} +Release: 11%{?dist} # The code includes the advertising clause, so it's GPL-incompatible License: BSD with advertising @@ -10,6 +10,7 @@ Source0: %{url}dist/%{name}-%{version}.tar.xz Source1: radvd.sysusers Patch0: radvd-c99-1.patch Patch1: radvd-c99-2.patch +Patch2: radvd-configure-c99.patch BuildRequires: make BuildRequires: gcc @@ -99,6 +100,9 @@ make check %{_sbindir}/radvdump %changelog +* Mon Nov 27 2023 Florian Weimer - 2.19-11 +- Backport upstream patch to fix another C99 issue in configure + * Fri Jul 21 2023 Fedora Release Engineering - 2.19-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild