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] [PATCH] Cleanups for Compile Warnings Under 64bit Linux

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Tue, 8 May 2007 11:24:40 -0700
On Sat, May 05, 2007 at 01:47:11PM -0700, Mike Duigou wrote:

> Enclosed is a patch which allows Wireshark to compile under 64 bit 
> Linux with treat-warnings-as-errors enabled.
>
> The changes are all in two categories :
> 
> - fix casts between int and pointer (using GINT_TO_POINTER/GPOINTER_TO_INT)
> 
> - fix %llx %llu and %lld printf formats (using PRIx64/PRIu64/PRId64).

When compiling your patch, I ran into a warning turned error on FreeBSD 
/ i386:

dcerpc_stat.c:403: warning: cast to pointer from integer of different 
size

The code is:

	SIGNAL_CONNECT(menu_item, "activate", dcerpcstat_version_select,
                       GINT_TO_POINTER(k->ver));

The problem is that GINT_TO_POINTER is for gint/int and k->ver is a 
guint16.  Could you look into this?

> Hopefully this will allow the amd64 built-bot to be switched to 
> treat-warnings-as-errors.

We actually don't have an amd64 build-bot these days, but being able to 
compile on such a platform is of course important for our users.


Steve