From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.devel Subject: Avoid warnings in sockets.c when HAVE_SIN6_SCOPE_ID is unavailable Date: Sat, 16 Jul 2016 20:16:35 +0300 Message-ID: <8337n95wr0.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1468689432 20079 80.91.229.3 (16 Jul 2016 17:17:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2016 17:17:12 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jul 16 19:17:08 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bOTD7-000821-8G for guile-devel@m.gmane.org; Sat, 16 Jul 2016 19:17:05 +0200 Original-Received: from localhost ([::1]:38235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOTD6-0000G0-FN for guile-devel@m.gmane.org; Sat, 16 Jul 2016 13:17:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOTCq-0000Fi-9u for guile-devel@gnu.org; Sat, 16 Jul 2016 13:16:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOTCl-0007BO-SW for guile-devel@gnu.org; Sat, 16 Jul 2016 13:16:47 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOTCl-0007BC-P8 for guile-devel@gnu.org; Sat, 16 Jul 2016 13:16:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4837 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bOTCj-0008JD-QL for guile-devel@gnu.org; Sat, 16 Jul 2016 13:16:42 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18548 Archived-At: 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); } }