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] Fwd: About building the wireshark

From: João Valverde <joao.valverde@xxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Mar 2016 09:37:42 +0100


On 28-03-2016 08:59, woniu1753@xxxxxxxxx wrote:
Hi,

Thanks for your help.
"-nn' works well now, but I got another problem as below: (I am a newbie
for C)

    make[2]: Leaving directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25/ui/qt'
    Making all in ui/gtk
    make[2]: Entering directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25/ui/gtk'
    make  all-am
    make[3]: Entering directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25/ui/gtk'
    depbase=`echo wireshark-gresources.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..  -I../.. -D_FORTIFY_SOURCE=2 -DG_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE -pthread -isystem/usr/include/gtk-3.0 -isystem/usr/include/pango-1.0 -isystem/usr/include/gio-unix-2.0/ -isystem/usr/include/atk-1.0 -isystem/usr/include/cairo -isystem/usr/include/gdk-pixbuf-2.0 -isystem/usr/include/freetype2 -isystem/usr/include/glib-2.0 -isystem/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem/usr/include/pixman-1 -isystem/usr/include/libpng12     -Werror -Wall -Wextra -Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -fwrapv -fno-strict-overflow -fno-delete-null-pointer-checks -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wc++-compat -Wdeclaration-after-statement -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-in
i
t -fexcess-precision=fast -fvisibility=hidden -g -O2 -MT wireshark-gresources.o -MD -MP -MF $depbase.Tpo -c -o wireshark-gresources.o wireshark-gresources.c &&\
    mv -f $depbase.Tpo $depbase.Po
    wireshark-gresources.c:9958:1: error: missing initializer [-Werror=missing-field-initializers]
    wireshark-gresources.c:9958:1: error: (near initialization for �static_resource.resource�) [-Werror=missing-field-initializers]
    cc1: all warnings being treated as errors
    make[3]: *** [wireshark-gresources.o] Error 1
    make[3]: Leaving directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25/ui/gtk'
    make[2]: *** [all] Error 2
    make[2]: Leaving directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25/ui/gtk'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/lqx/bin/wireshark-2.1.0-2469-g162df25'
    make: *** [all] Error 2


wireshark-gresources.c is a generated source file (using glib-compile-resources).

It seems the generated code is triggering compiler warnings. GTK+ 3.4 is somewhat old so personally I'm not too concerned by this.

One of our build-bots is using Ubuntu 12.04 with GTK+ 3.10 and the warning isn't showing there.

To get Wireshark to build you can try passing "--disable-warnings-as-errors" to configure.

(I also think it is misguided that -Werror is enabled by default but that is another topic).

Any issues you have feel free to ask.