X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Finet_ntop.c;h=1b1e13574e7d6da710beb677f1544b4245acffc4;hb=4430dd023d6c2b7b63a87fa62dcc2360c5a34a12;hp=d7e6b232fd82862ab94c97ea314a265523aa2fd0;hpb=e4196e8dce983586517ee1f25efbbf77ee14c439;p=gnulib.git
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index d7e6b232f..1b1e13574 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -13,8 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see . */
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
@@ -38,6 +37,16 @@
/* Specification. */
#include
+/* Use this to suppress gcc's "...may be used before initialized" warnings.
+ Beware: The Code argument must not contain commas. */
+#ifndef IF_LINT
+# ifdef lint
+# define IF_LINT(Code) Code
+# else
+# define IF_LINT(Code) /* empty */
+# endif
+#endif
+
#if HAVE_DECL_INET_NTOP
# undef inet_ntop
@@ -166,8 +175,9 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
for (i = 0; i < NS_IN6ADDRSZ; i += 2)
words[i / 2] = (src[i] << 8) | src[i + 1];
best.base = -1;
- best.len = 0;
cur.base = -1;
+ IF_LINT(best.len = 0);
+ IF_LINT(cur.len = 0);
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{
if (words[i] == 0)