Wireshark-dev: Re: [Wireshark-dev] [Patch] pragma warning
From: Stephen Fisher <[email protected]>
Date: Mon, 2 Apr 2007 16:13:07 -0700
On Wed, Mar 28, 2007 at 05:01:06PM +0200, Sebastien Tandel wrote:

> I made it partly for the Unix side. (Makefile.common and Makefile.am
> affected).
> The Makefile is, in fact, building now four libraries :
> - asn dissectors : libasndissectors.la
> - pidl dissectors : libpidldissectors.la
> - normal dissectors : libdissectors.la *and* libcleandissectors.la. I
> separated it in two libraries temporarily. The source files used to
> build libcleandissectors.la do not generate warning anymore and the
> -Werror is used to compile them. If we patch a dissector and it doesn't
> generate warning anymore, we have to move the filename dissector from
> DISSECTOR_SRC to CLEAN_DISSECTOR_SRC in epan/dissectors/Makefile.common.
> You can define specific cflags with, for example,
> libpidldissectors_la_CFLAGS.

Did you already commit these changes?  I don't see them in my svn tree.  
We're still compiling epan/dissectors with a ton of warnings from 
auto-generated dissectors on Unix.

There is only one warning left from the regular dissectors and I'm not
quite sure how to fix it properly:

packet-diameter.c: In function `dissect_avps':
packet-diameter.c:2057: warning: comparison between signed and unsigned

The relevant code is:

        if ( data.secs >= NTP_TIME_DIFF){

Where data is a nstime_t (and secs is a time_t).  NTP_TIME_DIFF is      
defined as 2208988800UL since it's too large to be a signed int/long.   
time_t is typically a signed value, but isn't guaranteed to be from what
I've read.  Making the value LL (long long) is only officially supported 
in c99, not the c90 that we code to.  Any ideas on how to fix this in a 
portable fashion?