Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Can't compile wireshark with gcc 6.3 and musl (Alpine Linux)

From: Adam Baxter <voltagex@xxxxxxxxxxxx>
Date: Mon, 25 Sep 2017 15:05:54 +1000
It's failing on extcap.

make[2]: Entering directory '/wireshark/extcap'
  CC       androiddump.o
  CC       extcap-base.o
  CC       randpktdump.o
  CC       udpdump.o
udpdump.c: In function 'setup_listener':
udpdump.c:126:9: error: variable 'timeout' has initializer but incomplete type
  struct timeval timeout = { 1, 0 };
         ^~~~~~~
udpdump.c:126:29: error: excess elements in struct initializer [-Werror]
  struct timeval timeout = { 1, 0 };
                             ^
udpdump.c:126:29: note: (near initialization for 'timeout')
udpdump.c:126:32: error: excess elements in struct initializer [-Werror]
  struct timeval timeout = { 1, 0 };
                                ^
udpdump.c:126:32: note: (near initialization for 'timeout')
udpdump.c:126:17: error: storage size of 'timeout' isn't known
  struct timeval timeout = { 1, 0 };
                 ^~~~~~~
udpdump.c:126:17: error: unused variable 'timeout' [-Werror=unused-variable]
cc1: all warnings being treated as errors
make[2]: *** [Makefile:789: udpdump.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/wireshark/extcap'
make[1]: *** [Makefile:3413: all-recursive] Error 1
make[1]: Leaving directory '/wireshark'
make: *** [Makefile:1736: all] Error 2
The command '/bin/sh -c cd wireshark && make -j8' returned a non-zero code: 2


The Dockerfile I'm using for this build is as follows:

ROM alpine:latest
MAINTAINER Adam Baxter <voltagex@xxxxxxxxxxxx>
RUN apk --update add git
RUN apk add gcc libc-dev make libtool autoconf automake python pkgconfig bison flex
RUN apk add libgcrypt-dev glib-dev libpcap-dev c-ares-dev
RUN cd wireshark && ./autogen.sh
RUN cd wireshark && ./configure --disable-wireshark --without-plugins --enable-static
RUN cd wireshark && make -j8


Any ideas? I suspect if I disable extcap it'll work which suits me, but I'd still like to know how to disable / fix the warnings-as-errors.

(I'm not subscribed, please cc me)

Thanks,
Adam