Wireshark-dev: Re: [Wireshark-dev] Compile warnings (Was: rev 40479)
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 13 Jan 2012 14:12:10 -0800
On Jan 13, 2012, at 1:47 PM, Joerg Mayer wrote:

> And finally, the build is finished:
> 
> /usr/bin/cmake -E cmake_progress_report /tmp/qt/CMakeFiles 
> [  5%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-dcerpc-dfs.c.o
> cd /tmp/qt/epan && /usr/bin/gcc  -Depan_EXPORTS -DHAVE_CONFIG_H -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -D_U_="__attribute__((unused))" -fPIC -I/tmp/qt -I/home/jmayer/work/wireshark/svn/trunk -I/home/jmayer/work/wireshark/svn/trunk/epan -I/home/jmayer/work/wireshark/svn/trunk/tools/lemon -I/home/jmayer/work/wireshark/svn/trunk/wiretap -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libpng14 -I/usr/include/python2.7 -I/tmp/qt/epan -I/home/jmayer/work/wireshark/svn/trunk/epan/dfilter -I/home/jmayer/work/wireshark/svn/trunk/epan/dissectors -I/home/jmayer/work/wireshark/svn/trunk/epan/ftypes -I/home/jmayer/work/wireshark/svn/trunk/epan/wslua -I/home/jmayer/work/wireshark/svn/trunk/epan/wspython    -O2 -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign -Warray-bounds -Wcast-align -Wformat-security -Wold-style-definition -fexcess-precision=fast -o CMakeFiles/epan.dir/dissectors/packet-dcerpc-dfs.c.o   -c /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-dfs.c
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-dfs.c: In function ‘netdfs_dissect_struct_dfs_Info0’:
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-dfs.c:591:14: warning: variable ‘tree’ set but not used [-Wunused-but-set-variable]

That looks like a deficiency in the PIDL-to-dissector code, generating an unnecessary ett_ value and subtree for an empty structure.

> /usr/bin/cmake -E cmake_progress_report /tmp/qt/CMakeFiles 
> [  5%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-dcerpc-mapi.c.o
> cd /tmp/qt/epan && /usr/bin/gcc  -Depan_EXPORTS -DHAVE_CONFIG_H -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -D_U_="__attribute__((unused))" -fPIC -I/tmp/qt -I/home/jmayer/work/wireshark/svn/trunk -I/home/jmayer/work/wireshark/svn/trunk/epan -I/home/jmayer/work/wireshark/svn/trunk/tools/lemon -I/home/jmayer/work/wireshark/svn/trunk/wiretap -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libpng14 -I/usr/include/python2.7 -I/tmp/qt/epan -I/home/jmayer/work/wireshark/svn/trunk/epan/dfilter -I/home/jmayer/work/wireshark/svn/trunk/epan/dissectors -I/home/jmayer/work/wireshark/svn/trunk/epan/ftypes -I/home/jmayer/work/wireshark/svn/trunk/epan/wslua -I/home/jmayer/work/wireshark/svn/trunk/epan/wspython    -O2 -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign -Warray-bounds -Wcast-align -Wformat-security -Wold-style-definition -fexcess-precision=fast -o CMakeFiles/epan.dir/dissectors/packet-dcerpc-mapi.c.o   -c /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c: In function ‘mapi_dissect_struct_Release_req’:
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c:8592:14: warning: variable ‘tree’ set but not used [-Wunused-but-set-variable]
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c: In function ‘mapi_dissect_struct_Release_repl’:
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c:8617:14: warning: variable ‘tree’ set but not used [-Wunused-but-set-variable]
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c: In function ‘mapi_dissect_struct_RecipSMTP’:
> /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-dcerpc-mapi.c:8848:14: warning: variable ‘tree’ set but not used [-Wunused-but-set-variable]

As does that.

What are the warnings in packet-gsm_a_common.c and packet-x11.c?