Re: [Wireshark-dev] Compile broken on 64-bit Linux -- packet-dtls.c

2007-04-17 Thread Jeff Morriss


Guy Harris wrote:
 On Apr 16, 2007, at 3:16 PM, Mike Duigou wrote:
 
 packet-dtls.c: In function 'dissect_dtls':
 packet-dtls.c:433: warning: cast to pointer from integer of  
 different size
 
 That call happens to do something that's probably safe on platforms  
 where
 
   1) int has no more bits than a pointer
 
 and
 
   2) converting from int to pointer doesn't mangle the bits
 
 which is true of all the platforms we currently support.

... and I thought compilers were (generally) supposed to not warn you if 
you're explicitly casting (on the assumption you should know what you're 
doing).

 However, it's still a good idea to fix it.  There is no code in  
 Wireshark that actually *uses* the DTLS tap, so we could just get rid  
 of the tap.  It seems a bit odd that the data passed to the tap is the  
 proto_dtls value - that doesn't seem like very interesting information  
 to pass to a tap, as it doesn't change from call to call.

The same warning shows up in packet-ssl.c (same problem).

There seem to be a lot of unused taps in there so I just changed the 
parameter to NULL for now--I guess if someone eventually wants to use it 
they can fill in some interesting data.

___
Wireshark-dev mailing list
Wireshark-dev@wireshark.org
http://www.wireshark.org/mailman/listinfo/wireshark-dev


[Wireshark-dev] Compile broken on 64-bit Linux -- packet-dtls.c

2007-04-16 Thread Mike Duigou
packet-dtls.c: In function 'dissect_dtls':
packet-dtls.c:433: warning: cast to pointer from integer of different size

I hope that with the recent emphasis on fixing warnings that all 
conversions between pointers and integers are now flagged as errors. For 
software like Wireshark which doesn't directly touch hardware or depend 
up on the internal representation format of pointers any conversion 
between a pointer type and a non-pointer type should always be highly 
suspect.

Expressions who's result is a ptrdiff_t or involve addition or 
subtraction of a ptrdiff_t are certainly fine of course...

Mike
___
Wireshark-dev mailing list
Wireshark-dev@wireshark.org
http://www.wireshark.org/mailman/listinfo/wireshark-dev


Re: [Wireshark-dev] Compile broken on 64-bit Linux -- packet-dtls.c

2007-04-16 Thread Guy Harris

On Apr 16, 2007, at 3:16 PM, Mike Duigou wrote:

 packet-dtls.c: In function 'dissect_dtls':
 packet-dtls.c:433: warning: cast to pointer from integer of  
 different size

That call happens to do something that's probably safe on platforms  
where

1) int has no more bits than a pointer

and

2) converting from int to pointer doesn't mangle the bits

which is true of all the platforms we currently support.

However, it's still a good idea to fix it.  There is no code in  
Wireshark that actually *uses* the DTLS tap, so we could just get rid  
of the tap.  It seems a bit odd that the data passed to the tap is the  
proto_dtls value - that doesn't seem like very interesting information  
to pass to a tap, as it doesn't change from call to call.
___
Wireshark-dev mailing list
Wireshark-dev@wireshark.org
http://www.wireshark.org/mailman/listinfo/wireshark-dev