guile-devel
[Top][All Lists]
Advanced

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

Avoid warnings in sockets.c when HAVE_SIN6_SCOPE_ID is unavailable


From: Eli Zaretskii
Subject: Avoid warnings in sockets.c when HAVE_SIN6_SCOPE_ID is unavailable
Date: Sat, 16 Jul 2016 20:16:35 +0300

    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;
                  ^

The patch to avoid this warning is below.  OK to commit?

--- libguile/socket.c~0 2016-01-02 16:24:55.000000000 +0200
+++ libguile/socket.c   2016-07-15 19:17:40.023250000 +0300
@@ -744,7 +744,9 @@ scm_fill_sockaddr (int fam, SCM address,
        int port;
        struct sockaddr_in6 *soka;
        unsigned long flowinfo = 0;
+#ifdef HAVE_SIN6_SCOPE_ID
        unsigned long scope_id = 0;
+#endif
 
        SCM_VALIDATE_CONS (which_arg + 1, *args);
        port = scm_to_int (SCM_CAR (*args));
@@ -755,8 +757,10 @@ scm_fill_sockaddr (int fam, SCM address,
            *args = SCM_CDR (*args);
            if (scm_is_pair (*args))
              {
+#ifdef HAVE_SIN6_SCOPE_ID
                SCM_VALIDATE_ULONG_COPY (which_arg + 3, SCM_CAR (*args),
                                         scope_id);
+#endif
                *args = SCM_CDR (*args);
              }
          }



reply via email to

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