From 31557e9c770d9da7199a64f40f17f50a6686bcb1 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Thu, 3 Jun 2021 18:26:31 -0300 Subject: gcov: add missing gcov.h includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following "implicit declaration" warning (13 occurrences in total) when building with gcov support: $ pacman -Q gcc10 gcc10 1:10.2.0-3 $ CC=gcc-10 && export CC $ ./configure --prefix=/usr --enable-apparmor --enable-gcov >/dev/null $ make >/dev/null appimage.c: In function ‘appimage_set’: appimage.c:140:2: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 140 | __gcov_flush(); | ^~~~~~~~~~~~ interface.c: In function ‘print_sandbox’: interface.c:149:3: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 149 | __gcov_flush(); | ^~~~~~~~~~~~ netstats.c: In function ‘netstats’: netstats.c:246:4: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 246 | __gcov_flush(); | ^~~~~~~~~~~~ [...] Note: The commands above were executed from makepkg, while building firejail-git from the AUR. Note2: gcc-10 was used because the build fails with the current gcc version (11.1.0) on Artix Linux. The failure happens because __gcov_flush was removed on gcc 11.1.0[1]; this will be addressed later. Note3: The following command helped find the affected files: $ git grep -Fl __gcov -- src [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=811b7636cb8c10f1a550a76242b5666c7ae36da2 --- src/firemon/interface.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/firemon/interface.c') diff --git a/src/firemon/interface.c b/src/firemon/interface.c index e04b6f431..b93d4a5a2 100644 --- a/src/firemon/interface.c +++ b/src/firemon/interface.c @@ -33,6 +33,10 @@ //#include //#include +#ifdef HAVE_GCOV +#include +#endif + // print IP addresses for all interfaces static void net_ifprint(void) { uint32_t ip; -- cgit v1.2.3-54-g00ecf