diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-03-21 14:54:59 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-03-21 16:38:06 +0100 |
commit | 34ade90957ddc5086cc17dc1af47ca640aa650e5 (patch) | |
tree | 7ab3ade484f8eda80873d0d75daa9231c5c25d23 /tcp_splice.c | |
parent | ccf6d2a7b48d08c23c16a618d5f8e148c3fc84de (diff) | |
download | passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar.gz passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar.bz2 passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar.lz passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar.xz passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.tar.zst passt-34ade90957ddc5086cc17dc1af47ca640aa650e5.zip |
Work around weird false positives with cppcheck-2.9.1
Commit 89e38f55 "treewide: Fix header includes to build with musl" added
extra #includes to work with musl. Unfortunately with the cppcheck version
I'm using (cppcheck-2.9-1.fc37.x86_64 in Fedora 37) this causes weird false
positives: specifically cppcheck seems to hit a #error in <bits/unistd.h>
complaining about including it directly instead of via <unistd.h> (which is
not something we're doing).
I have no idea why that would be happening; but I'm guessing it has to be
a bug in the cpp implementation in that cppcheck version. In any case,
it's possible to work around this by moving the include of <unistd.h>
before the include of <signal.h>. So, do that.
Fixes: 89e38f55405d ("treewide: Fix header includes to build with musl")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r-- | tcp_splice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp_splice.c b/tcp_splice.c index 6559762..5bfad2a 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -32,6 +32,7 @@ */ #include <sched.h> +#include <unistd.h> #include <signal.h> #include <errno.h> #include <fcntl.h> @@ -40,7 +41,6 @@ #include <stdbool.h> #include <string.h> #include <time.h> -#include <unistd.h> #include <net/ethernet.h> #include <netinet/in.h> #include <netinet/tcp.h> |