This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 0b8b5da851 fixed the unused variable caused warnning in
lib_gethostbyaddrr
0b8b5da851 is described below
commit 0b8b5da8513a1fd63b1d9aa14f37c0436f0994b8
Author: yangshuyong <[email protected]>
AuthorDate: Wed Jun 28 11:07:49 2023 +0800
fixed the unused variable caused warnning in lib_gethostbyaddrr
lib_gethostbyaddrr.c: warning: label 'out_copyname' defined but not used
[-Wunused-label] 204 | out_copyname:
Signed-off-by: yangshuyong <[email protected]>
---
libs/libc/netdb/lib_gethostbyaddrr.c | 2 ++
libs/libc/netdb/lib_gethostentbynamer.c | 3 +++
2 files changed, 5 insertions(+)
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)
{