compiler warning: fix
authorYang Tse <yangsita@gmail.com>
Wed, 25 May 2011 09:19:10 +0000 (11:19 +0200)
committerYang Tse <yangsita@gmail.com>
Wed, 25 May 2011 09:19:10 +0000 (11:19 +0200)
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored

acountry.c
adig.c
ahost.c
ares_fds.c
ares_nowarn.c
ares_nowarn.h
ares_process.c

index 4c2816a..d989018 100644 (file)
@@ -59,6 +59,7 @@
 #include "ares_getopt.h"
 #include "inet_net_pton.h"
 #include "inet_ntop.h"
+#include "ares_nowarn.h"
 
 #ifndef HAVE_STRDUP
 #  include "ares_strdup.h"
diff --git a/adig.c b/adig.c
index 8b5c883..9e3c553 100644 (file)
--- a/adig.c
+++ b/adig.c
@@ -57,6 +57,7 @@
 #include "inet_ntop.h"
 #include "inet_net_pton.h"
 #include "ares_getopt.h"
+#include "ares_nowarn.h"
 
 #ifndef HAVE_STRDUP
 #  include "ares_strdup.h"
diff --git a/ahost.c b/ahost.c
index 6a4843e..fb67f1f 100644 (file)
--- a/ahost.c
+++ b/ahost.c
@@ -42,6 +42,7 @@
 #include "inet_net_pton.h"
 #include "ares_getopt.h"
 #include "ares_ipv6.h"
+#include "ares_nowarn.h"
 
 #ifndef HAVE_STRDUP
 #  include "ares_strdup.h"
index b57be92..ac5eedb 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include "ares.h"
+#include "ares_nowarn.h"
 #include "ares_private.h"
 
 int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
index 0c77771..bc2c5da 100644 (file)
@@ -21,6 +21,8 @@
 #  include <assert.h>
 #endif
 
+#define BUILDING_ARES_NOWARN_C 1
+
 #include "ares_nowarn.h"
 
 #if (SIZEOF_INT == 2)
@@ -111,3 +113,31 @@ unsigned int aresx_sztoui(ssize_t sznum)
 #  pragma warning(pop)
 #endif
 }
+
+#if defined(__INTEL_COMPILER) && defined(__unix__)
+
+int aresx_FD_ISSET(int fd, fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:1469) /* clobber ignored */
+  return FD_ISSET(fd, fdset);
+  #pragma warning(pop)
+}
+
+void aresx_FD_SET(int fd, fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:1469) /* clobber ignored */
+  FD_SET(fd, fdset);
+  #pragma warning(pop)
+}
+
+void aresx_FD_ZERO(fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:593) /* variable was set but never used */
+  FD_ZERO(fdset);
+  #pragma warning(pop)
+}
+
+#endif /* __INTEL_COMPILER && __unix__ */
index 6aa478f..0cc204c 100644 (file)
@@ -2,7 +2,7 @@
 #define HEADER_CARES_NOWARN_H
 
 
-/* Copyright (C) 2010 by Daniel Stenberg
+/* Copyright (C) 2010-2011 by Daniel Stenberg
  *
  * Permission to use, copy, modify, and distribute this
  * software and its documentation for any purpose and without
@@ -25,4 +25,23 @@ int aresx_sztosi(ssize_t sznum);
 
 unsigned int aresx_sztoui(ssize_t sznum);
 
+#if defined(__INTEL_COMPILER) && defined(__unix__)
+
+int aresx_FD_ISSET(int fd, fd_set *fdset);
+
+void aresx_FD_SET(int fd, fd_set *fdset);
+
+void aresx_FD_ZERO(fd_set *fdset);
+
+#ifndef BUILDING_ARES_NOWARN_C
+#  undef  FD_ISSET
+#  define FD_ISSET(a,b) aresx_FD_ISSET((a),(b))
+#  undef  FD_SET
+#  define FD_SET(a,b)   aresx_FD_SET((a),(b))
+#  undef  FD_ZERO
+#  define FD_ZERO(a)    aresx_FD_ZERO((a))
+#endif
+
+#endif /* __INTEL_COMPILER && __unix__ */
+
 #endif /* HEADER_CARES_NOWARN_H */
index f5e7d25..e5efa5f 100644 (file)
@@ -66,6 +66,7 @@
 
 #include "ares.h"
 #include "ares_dns.h"
+#include "ares_nowarn.h"
 #include "ares_private.h"