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] about configure --enable-warnings-as-errors

From: didier <dgautheron@xxxxxxxx>
Date: Tue, 22 May 2007 00:46:11 +0200
On lun, 2007-05-21 at 14:54 -0700, Stephen Fisher wrote:
> On Mon, May 21, 2007 at 11:38:27PM +0200, didier wrote:
> 
> > I'm trying to compile wireshark svn HEAD and I have warning, so error 
> > like
> > 
> > warning: comparison is always false due to limited range of data type
> > 
> > With what seems to be default signed/unsigned char tests with negative 
> > value.
> > 
> > Does it means that wireshark expects signed char? Or are they bugs?
> 
> It depends.  What part of the code (file name and line number) is it 
> referring to in the warning?
There's only two (don't have the log anymore)

in packet-iuup.c and packet-mtp2.c

Didier

Index: dissectors/packet-iuup.c
===================================================================
--- dissectors/packet-iuup.c	(révision 21866)
+++ dissectors/packet-iuup.c	(copie de travail)
@@ -398,9 +398,9 @@
     unsigned int data = ( byte1<<8 | byte2 ) << 6;
     remainder = data;
 
-    for (bit = 15; bit >= 0; --bit)
+    for (bit = 16; bit > 0; --bit)
     {
-        if (remainder & (0x40 << bit))
+        if (remainder & (0x20 << bit))
         {
             remainder ^= polynomial;
         }
Index: packet_info.h
===================================================================
--- packet_info.h	(révision 21866)
+++ packet_info.h	(copie de travail)
@@ -33,7 +33,7 @@
 #define P2P_DIR_SENT	0
 #define P2P_DIR_RECV	1
 
-#define MTP2_ANNEX_A_USED_UNKNOWN -1
+#define MTP2_ANNEX_A_USED_UNKNOWN ((gchar)-1)
 #define MTP2_ANNEX_A_NOT_USED      0
 #define MTP2_ANNEX_A_USED          1