guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid warnings in sockets.c when HAVE_SIN6_SCOPE_ID is unavailable


From: Mark H Weaver
Subject: Re: Avoid warnings in sockets.c when HAVE_SIN6_SCOPE_ID is unavailable
Date: Wed, 10 Aug 2016 02:49:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi Eli,

Eli Zaretskii <address@hidden> writes:

>     CC       libguile_2.0_la-socket.lo
>   socket.c: In function 'scm_fill_sockaddr':
>   socket.c:747:16: warning: variable 'scope_id' set but not used 
> [-Wunused-but-set-variable]
>     unsigned long scope_id = 0;
>                 ^

How about this?

--8<---------------cut here---------------start------------->8---
diff --git a/libguile/socket.c b/libguile/socket.c
index 3229ac8..beff305 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -744,7 +744,7 @@ scm_fill_sockaddr (int fam, SCM address, SCM *args, int 
which_arg,
        int port;
        struct sockaddr_in6 *soka;
        unsigned long flowinfo = 0;
-       unsigned long scope_id = 0;
+       unsigned long scope_id SCM_UNUSED = 0;
 
        SCM_VALIDATE_CONS (which_arg + 1, *args);
        port = scm_to_int (SCM_CAR (*args));
--8<---------------cut here---------------end--------------->8---

See the definition of SCM_UNUSED in __scm.h.

What do you think?

      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]