Wireshark-dev: Re: [Wireshark-dev] Compiling Wireshark for Win32
From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Wed, 10 Aug 2011 17:50:28 +0100
On 10/08/2011 17:18, news.gmane.com wrote:
> Hello,
>
> I am a bit surprised about a problem with compiling Wireshark 1.6.0 with 
> Visual Studio 2005 for Win32. Some dissectors have assignments from 64 to 32 
> bit, what will issue a warning C4244 by the compiler. Since the -WX 
> parameter is passed to the compiler, the compilation fails. The warning 
> level /W3 will not suppress the warning C4244 but /W2 would do.
>
> example: packet-afp.c
> function: dissect_spotlight
> line: 3999
>     toc_offset = (spotlight_ntoh64(tvb, offset) >> 32) * 8 - 8;
> where the variable is defines as
>     gint toc_offset;
> Compiler output:
>
> packet-afp.c
> packet-afp.c(3999) : error C2220: warning treated as error - no 'object' 
> file generated
> packet-afp.c(3999) : warning C4244: '=' : conversion from 'guint64' to 
> 'gint', possible loss of data
>
> Why did this pass the compilation at wireshark.org?
> How do I recompile Wireshark 1.6.0?
>
> This affects also
>
> packet-ieee802154.c(2162) : warning C4244: 'return' : conversion from 
> 'guint64' to 'guint', possible loss of data
>
> packet-netflow.c(2623) : warning C4244: '=' : conversion from 'guint64' to 
> 'int', possible loss of data
>
>
In the trunk these all have appropriate casts so no warnings are issued.  For
example packet-afp.c was fixed by r37694 on 17th June 2011.

-- 
Regards,

Graham Bloice