Skip to content

Build failure with GCC 7.5, Linux

Summary

Compile error in glib-compat.h included from funnel.c

Steps to reproduce

On SUSE Linux 15, GCC 7.5 installed: checkout current sources, cmake, make.

What is the current bug behavior?

[ 75%] Building C object epan/CMakeFiles/epan.dir/frame_data_sequence.c.o
[ 75%] Building C object epan/CMakeFiles/epan.dir/funnel.c.o
In file included from /home/paul_koning/wireshark/epan/funnel.c:18:0:
/home/paul_koning/wireshark/wsutil/glib-compat.h: In function ‘g_memdup2’:
/home/paul_koning/wireshark/wsutil/glib-compat.h:32:7: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
       memcpy(new_mem, mem, byte_size);
       ^~~~~~
/home/paul_koning/wireshark/wsutil/glib-compat.h:32:7: error: incompatible implicit declaration of built-in function ‘memcpy’ [-Werror]
/home/paul_koning/wireshark/wsutil/glib-compat.h:32:7: note: include ‘<string.h’ or provide a declaration of ‘memcpy’
cc1: all warnings being treated as errors
make[2]: *** [epan/CMakeFiles/epan.dir/build.make:926: epan/CMakeFiles/epan.dir/funnel.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2360: epan/CMakeFiles/epan.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

What is the expected correct behavior?

Good build

I found that I can cure the issue, as suggested by the error message, by adding #include <string.h> in glib-compat.h

Sample capture file

N/A

Relevant logs and/or screenshots

(Paste any relevant logs here)

(Paste any relevant screenshots here)

Build information

:~/wireshark/build> gcc --version
gcc (SUSE Linux) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Edited by Guy Harris
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information