Wireshark-dev: Re: [Wireshark-dev] Compilation failure in gtk/stats_tree_stat.c
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 2 Dec 2013 11:40:25 -0800
On Dec 2, 2013, at 2:55 AM, Joerg Mayer <jmayer@xxxxxxxxx> wrote:

> [ 83%] Building C object ui/gtk/CMakeFiles/gtkui.dir/stats_tree_stat.c.o
> /home/jmayer/work/wireshark/svn/trunk/ui/gtk/stats_tree_stat.c: In function ‘save_as_dialog’:
> /home/jmayer/work/wireshark/svn/trunk/ui/gtk/stats_tree_stat.c:296:3: error: enum conversion when passing argument 2 of ‘stats_tree_format_as_str’ is invalid in C++ [-Werror=c++-compat]
>   str_tree=stats_tree_format_as_str(st,file_type,sort_column-N_RESERVED_COL,order==GTK_SORT_DESCENDING);
>   ^
> In file included from /home/jmayer/work/wireshark/svn/trunk/ui/gtk/stats_tree_stat.c:41:0:
> /home/jmayer/work/wireshark/svn/trunk/epan/stats_tree_priv.h:283:24: note: expected ‘st_format_type’ but argument is of type ‘int’
> WS_DLL_PUBLIC GString* stats_tree_format_as_str(const stats_tree* st,
>                        ^
> cc1: all warnings being treated as errors
> make[2]: *** [ui/gtk/CMakeFiles/gtkui.dir/stats_tree_stat.c.o] Error 1

Cast added to squelch the warning.

A pointer to file_type is passed to file-save-dialog routines, so I'm not sure it can be made an enum variable.