diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2021-06-03 18:26:31 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2021-06-18 14:48:56 -0300 |
commit | 31557e9c770d9da7199a64f40f17f50a6686bcb1 (patch) | |
tree | c172939c5548c05409caf42955ba015a98480d53 /src/firejail/util.c | |
parent | appimage: automatically detect profile (diff) | |
download | firejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.tar.gz firejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.tar.zst firejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.zip |
gcov: add missing gcov.h includes
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
Diffstat (limited to 'src/firejail/util.c')
-rw-r--r-- | src/firejail/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index edd08bb41..47c367aad 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -41,6 +41,10 @@ | |||
41 | #include <linux/openat2.h> | 41 | #include <linux/openat2.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #ifdef HAVE_GCOV | ||
45 | #include <gcov.h> | ||
46 | #endif | ||
47 | |||
44 | #define MAX_GROUPS 1024 | 48 | #define MAX_GROUPS 1024 |
45 | #define MAXBUF 4098 | 49 | #define MAXBUF 4098 |
46 | #define EMPTY_STRING ("") | 50 | #define EMPTY_STRING ("") |