From: Andrii Nakryiko <andriin@fb.com>
To: <yhs@fb.com>, <songliubraving@fb.com>, <ast@fb.com>,
<kafai@fb.com>, <netdev@vger.kernel.org>, <kernel-team@fb.com>
Cc: Andrii Nakryiko <andriin@fb.com>
Subject: [PATCH bpf-next] tools/bpf: add missing strings.h include
Date: Thu, 7 Feb 2019 09:50:27 -0800 [thread overview]
Message-ID: <20190207175027.1950358-1-andriin@fb.com> (raw)
Few files in libbpf are using bzero() function (defined in strings.h header), but
don't include corresponding header. When libbpf is added as a dependency to pahole,
this undeterministically causes warnings on some machines:
bpf.c:225:2: warning: implicit declaration of function ‘bzero’ [-Wimplicit-function-declaration]
bzero(&attr, sizeof(attr));
^~~~~
---
tools/lib/bpf/bpf.c | 1 +
tools/lib/bpf/btf.c | 1 +
tools/lib/bpf/libbpf.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 3defad77dc7a..92fd27fe0599 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -22,6 +22,7 @@
*/
#include <stdlib.h>
+#include <strings.h>
#include <memory.h>
#include <unistd.h>
#include <asm/unistd.h>
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index ab6528c935a1..4324eb47d214 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include <errno.h>
#include <linux/err.h>
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 47969aa0faf8..8d64ada5f728 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -18,6 +18,7 @@
#include <libgen.h>
#include <inttypes.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
--
2.17.1
next reply other threads:[~2019-02-07 17:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 17:50 Andrii Nakryiko [this message]
2019-02-07 19:02 ` [PATCH bpf-next] tools/bpf: add missing strings.h include Andrii Nakryiko
2019-02-07 19:18 ` Alexei Starovoitov
2019-02-07 19:21 ` Arnaldo Carvalho de Melo
2019-02-07 19:23 ` Andrii Nakryiko
2019-02-08 10:23 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190207175027.1950358-1-andriin@fb.com \
--to=andriin@fb.com \
--cc=ast@fb.com \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.