Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 May 2023 19:15:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 271131] net/asterisk18: utils.c:99:12: error: static declaration of 'gethostbyname_r' follows non-static declaration
Message-ID:  <bug-271131-7788-f0YKIOh7oQ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-271131-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-271131-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271131

--- Comment #6 from O. Hartmann <ohartmann@walstatt.org> ---
Hello,

I'm running into the very same issue here on CURRENT builder host, running
13-STABLE jail:

=3D>> Building net/asterisk18
build started at Mon May  8 08:36:14 UTC 2023
port directory: /usr/ports/net/asterisk18
package name: asterisk18-18.17.1_1
[...]
13.2-STABLE 1302505 amd64
[...]
/net/asterisk18/Makefile
Ports top last git commit: ec23a17e0f51
Ports top unclean checkout: no
Port dir last git commit: 6ee7f9f1ae2e
Port dir unclean checkout: no
Poudriere version: poudriere-git-3.3.99.20220831
Host OSVERSION: 1400088
Jail OSVERSION: 1302505
Job Id: 02

poudriere shows the very same error as reported before.

My understanding of the techniques of the C code is limited, but looking at=
=20

main/utils.c

reveals that there is a static declaration of gethostbyname_r() (as reporte=
d in
the error) for which the comment says it is a replacement for BSD-versions,=
 see
below.

Checking the manpages for gethostbyname_r(), found in libc, obviously
prototyped in /usr/include/netdb.h definitely states, that the routine is
threadsafe AND reentrant!
I have not checked with upstream so far, but I found it logic to eliminate =
the
extranous gehthostbyname_r() routine in main/utils.c with the (clumsy) #ifd=
ef
clause show below - and the code is compiling. Haven't tested it.

I have no idea since when the code starts to bread to determine
__FreeBSD_version, but this might be a first approach to a workaround?

Otherwise, sorry for the noise, if the suggestion is illogical and ill-advi=
ced.

[... main/utisl.c ...]
/*! \brief Reentrant replacement for gethostbyname for BSD-based systems.
\note This
routine is derived from code originally written and placed in the public
domain by Enzo Michelangeli <em@em.no-ip.com> */

#if !defined(__FreeBSD__)
static int gethostbyname_r (const char *name, struct hostent *ret, char *bu=
f,
                size_t buflen, struct hostent **result,
                int *h_errnop)
[...]
}
#endif

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271131-7788-f0YKIOh7oQ>