Wireshark mailing list archives

Re: buildbot failure in Wireshark (development) on Visual-Studio-Code-Analysis


From: Ed Beroset <beroset () mindspring com>
Date: Mon, 28 Mar 2011 21:54:43 -0400

Chris Maynard wrote:
Stephen Fisher<steve@...>  writes:

packet-vnc.c(1970) : warning C4018: '>' : signed/unsigned mismatch

Any ideas?

I added a cast that fixes it.  I'm not 100% sure why the warning, but I think it
might be because the multiplication operation promotes the guint8's to int's.

Yes, that's exactly right. Since the original code just passed the product of two guint8 quantities into a macro, the compiler is, at least according to my understanding of C99, free to promote that product to either a signed or unsigned int if either would be sufficiently large to hold the result (which is the case for 32-bit ints or uints).

Ed
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: