avoid compiler warning with DEBUGGING

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

avoid compiler warning with DEBUGGING

Eric Blake (cygwin)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I noticed a complaint about comparing signed and unsigned values, when
compiling with DEBUGGING enabled.  net.cc also has a lot of trailing blanks.

2009-05-20  Eric Blake  <[hidden email]>

        * net.cc (gethostby_helper): Use correct signedness.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [hidden email]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoT/McACgkQ84KuGfSFAYB5yACbBSHBbYlplWSHVtl32doXLLRP
tFYAni2YcsLFsNUgUp62jYlqGc82jD/y
=WPYH
-----END PGP SIGNATURE-----

diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index cb0a5cd..79b2dfa 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -960,7 +960,8 @@ gethostby_helper (const char *name, const int af, const int type,

   record * anptr = NULL, * prevptr = NULL, * curptr;
   int i, alias_count = 0, string_size = 0, address_count = 0;
-  int complen, namelen1 = 0, address_len = 0, antype, anclass, ansize;
+  unsigned int complen;
+  int namelen1 = 0, address_len = 0, antype, anclass, ansize;

   /* Get the count of answers */
   ancount = ntohs (((HEADER *) msg)->ancount);
--
1.6.2.4

Reply | Threaded
Open this post in threaded view
|

Re: avoid compiler warning with DEBUGGING

Christopher Faylor-8
On Wed, May 20, 2009 at 06:51:19AM -0600, Eric Blake wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>I noticed a complaint about comparing signed and unsigned values, when
>compiling with DEBUGGING enabled.  net.cc also has a lot of trailing blanks.
>
>2009-05-20  Eric Blake  <[hidden email]>
>
> * net.cc (gethostby_helper): Use correct signedness.

I've applied this even though I couldn't duplicate the problem with gcc 4.
I think that may be a first since gcc 4 is much more picky than gcc 3.4.

Thanks.

cgf