]> granicus.if.org Git - curl/commitdiff
if2ip: fix compiler warning in ISO C90 mode
authorMarcel Raad <raad@teamviewer.com>
Tue, 20 Jun 2017 20:33:56 +0000 (22:33 +0200)
committerMarcel Raad <raad@teamviewer.com>
Tue, 20 Jun 2017 20:33:56 +0000 (22:33 +0200)
remote_scope_id is only used when both HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
and ENABLE_IPV6 are defined instead of only one of them.

lib/if2ip.c

index 4de81be60e099736ce4a333291df5021e0fecc21..3e74cc68761464f3337005611f4e26ca192bf7fd 100644 (file)
@@ -121,11 +121,11 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
 
 #ifndef ENABLE_IPV6
   (void) remote_scope;
-
-#ifndef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-  (void) remote_scope_id;
 #endif
 
+#if !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) || \
+    !defined(ENABLE_IPV6)
+  (void) remote_scope_id;
 #endif
 
   if(getifaddrs(&head) >= 0) {