public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/asterisk] epel8: Backport upstream patch to fix C compatibility issue
Date: Mon, 02 Nov 2026 14:33:24 GMT	[thread overview]
Message-ID: <179363000462.1.17244022738138516599.rpms-asterisk-1aa3344d4666@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/asterisk
            Branch : epel8
            Commit : 1aa3344d46664bac64ef2389762f6d3ebc0daa13
            Author : Florian Weimer <fweimer@redhat.com>
            Date   : 2023-11-28T18:14:17+01:00
            Stats  : +73/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/asterisk/c/1aa3344d46664bac64ef2389762f6d3ebc0daa13?branch=epel8

            Log:
            Backport upstream patch to fix C compatibility issue

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>

---
diff --git a/asterisk-configure-c99.patch b/asterisk-configure-c99.patch
new file mode 100644
index 0000000..9faa08b
--- /dev/null
+++ b/asterisk-configure-c99.patch
@@ -0,0 +1,65 @@
+commit 0e6295128c605f1cf41d897c53e6e23e893a6ffa
+Author: Jaco Kroon <jaco@uls.co.za>
+Date:   Mon May 15 14:50:36 2023 +0200
+
+    configure: fix test code to match gethostbyname_r prototype. (#75)
+    
+    This enables the test to work with CC=clang.
+    
+    Without this the test for 6 args would fail with:
+    
+    utils.c:99:12: error: static declaration of 'gethostbyname_r' follows non-static declaration
+    static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
+               ^
+    /usr/include/netdb.h:177:12: note: previous declaration is here
+    extern int gethostbyname_r (const char *__restrict __name,
+               ^
+    
+    Fixing the expected return type to int sorts this out.
+    
+    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
+
+diff --git a/configure b/configure
+index 979cf7fbd2..439bba2cdc 100755
+--- a/configure
++++ b/configure
+@@ -17518,7 +17518,7 @@ $as_echo_n "checking for gethostbyname_r with 6 arguments... " >&6; }
+ int
+ main (void)
+ {
+-struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);
++int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);
+   ;
+   return 0;
+ }
+@@ -17546,7 +17546,7 @@ $as_echo_n "checking for gethostbyname_r with 5 arguments... " >&6; }
+ int
+ main (void)
+ {
+-struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);
++int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);
+   ;
+   return 0;
+ }
+diff --git a/configure.ac b/configure.ac
+index 5d4187a552..db76aad6c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -961,7 +961,7 @@ if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then
+         AC_LINK_IFELSE(
+                 [AC_LANG_PROGRAM([#include <stdlib.h>
+                                  #include <netdb.h>],
+-                                [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
++                                [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
+                 AC_MSG_RESULT(yes)
+                 AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
+                 AC_MSG_RESULT(no)
+@@ -971,7 +971,7 @@ if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then
+         AC_LINK_IFELSE(
+                 [AC_LANG_PROGRAM([#include <stdlib.h>
+ 	                         #include <netdb.h>],
+-                                [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
++                                [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
+                 AC_MSG_RESULT(yes)
+                 AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
+                 AC_MSG_RESULT(no)

diff --git a/asterisk.spec b/asterisk.spec
index 13b56f0..3e34f2c 100644
--- a/asterisk.spec
+++ b/asterisk.spec
@@ -51,7 +51,7 @@
 Summary:          The Open Source PBX
 Name:             asterisk
 Version:          18.12.1
-Release:          %{?_rc||?_beta:0.}1%{?_rc:.rc%{_rc}}%{?_beta:.beta%{_beta}}%{?dist}.4
+Release:          %{?_rc||?_beta:0.}1%{?_rc:.rc%{_rc}}%{?_beta:.beta%{_beta}}%{?dist}.5
 License:          GPLv2
 URL:              http://www.asterisk.org/
 
@@ -95,6 +95,8 @@ Patch2:           asterisk-18.4.0-astmm_ignore_for_console_board.patch
 # Removed macros from ilbc library for RFC 3951 compatibility.
 Patch3:           asterisk-18.12.1-ilbc_macros.patch
 
+Patch4:           asterisk-configure-c99.patch
+
 # Asterisk now builds against a bundled copy of pjproject, as they apply some patches
 # directly to pjproject before the build against it
 Provides:         bundled(pjproject) = %{pjsip_version}
@@ -658,6 +660,8 @@ echo '*************************************************************************'
 
 %patch3 -p1
 
+%patch4 -p1
+
 cp %{S:3} menuselect.makedeps
 cp %{S:4} menuselect.makeopts
 
@@ -1685,6 +1689,9 @@ fi
 %endif
 
 %changelog
+* Tue Nov 28 2023 Florian Weimer <fweimer@redhat.com> - 18.12.1-1.5
+- Backport upstream patch to fix C compatibility issue
+
 * Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 18.12.1-1.4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
 

                 reply	other threads:[~2026-11-02 14:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179363000462.1.17244022738138516599.rpms-asterisk-1aa3344d4666@fedoraproject.org \
    --to=fweimer@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox