diff --git a/libs/libc/netdb/lib_gethostbyaddrr.c b/libs/libc/netdb/lib_gethostbyaddrr.c index d96ff24d00..b12f9158c9 100644 --- a/libs/libc/netdb/lib_gethostbyaddrr.c +++ b/libs/libc/netdb/lib_gethostbyaddrr.c @@ -201,7 +201,9 @@ static int lib_localhost(FAR const void *addr, socklen_t len, int type, return 1; +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6) out_copyname: +#endif /* And copy localhost host name */ diff --git a/libs/libc/netdb/lib_gethostentbynamer.c b/libs/libc/netdb/lib_gethostentbynamer.c index 8fd8df5ad9..27c5dec04f 100644 --- a/libs/libc/netdb/lib_gethostentbynamer.c +++ b/libs/libc/netdb/lib_gethostentbynamer.c @@ -228,7 +228,10 @@ static int lib_localhost(FAR const char *name, FAR struct hostent_s *host, FAR struct hostent_info_s *info; FAR char *dest; int namelen; + +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6) int i = 0; +#endif if (strcmp(name, g_lo_hostname) == 0) {