ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] buildbot failure in Wireshark (development) on Visual-Studio

From: Ed Beroset <beroset@xxxxxxxxxxxxxx>
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