mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 18:00:28 +00:00
Fix ForwardLookup(): "ISO C90 forbids specifying subobject to initialize"
This patch fixes the following warning of GCC (version 4.3.2) in function ForwardLookup(): resolve.c: In function 'ForwardLookup': resolve.c:282: warning: ISO C90 forbids specifying subobject to initialize resolve.c:284: warning: ISO C90 forbids specifying subobject to initialize resolve.c:285: warning: ISO C90 forbids specifying subobject to initialize
This commit is contained in:
parent
ce2541a826
commit
34b2f0085d
@ -271,19 +271,21 @@ static bool
|
|||||||
ForwardLookup(const char *hostname, array *IpAddr)
|
ForwardLookup(const char *hostname, array *IpAddr)
|
||||||
{
|
{
|
||||||
ng_ipaddr_t addr;
|
ng_ipaddr_t addr;
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef HAVE_GETADDRINFO
|
||||||
int res;
|
int res;
|
||||||
struct addrinfo *a, *ai_results;
|
struct addrinfo *a, *ai_results;
|
||||||
static struct addrinfo hints = {
|
static struct addrinfo hints;
|
||||||
|
|
||||||
#ifndef WANT_IPV6
|
#ifndef WANT_IPV6
|
||||||
.ai_family = AF_INET,
|
hints.ai_family = AF_INET;
|
||||||
#endif
|
#endif
|
||||||
#ifdef AI_ADDRCONFIG /* glibc has this, but not e.g. netbsd 4.0 */
|
#ifdef AI_ADDRCONFIG /* glibc has this, but not e.g. netbsd 4.0 */
|
||||||
.ai_flags = AI_ADDRCONFIG,
|
hints.ai_flags = AI_ADDRCONFIG;
|
||||||
#endif
|
#endif
|
||||||
.ai_socktype = SOCK_STREAM,
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
.ai_protocol = IPPROTO_TCP
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
};
|
|
||||||
#ifdef WANT_IPV6
|
#ifdef WANT_IPV6
|
||||||
assert(Conf_ConnectIPv6 || Conf_ConnectIPv4);
|
assert(Conf_ConnectIPv6 || Conf_ConnectIPv4);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user