On Mon, Mar 28, 2011 at 09:54:43PM -0400, Ed Beroset wrote:
> 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).

Thanks Chris and Ed.  It makes perfect sense now.
___________________________________________________________________________
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-requ...@wireshark.org?subject=unsubscribe

Reply via email to