BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2] selftests/bpf: allow veristat compile standalone
@ 2025-07-02 17:56 Mykyta Yatsenko
  2025-07-02 18:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Mykyta Yatsenko @ 2025-07-02 17:56 UTC (permalink / raw)
  To: bpf, ast, andrii, daniel, kafai, kernel-team, eddyz87; +Cc: Mykyta Yatsenko

From: Mykyta Yatsenko <yatsenko@meta.com>

Veristat is synced into the standalone repo, where it compiles without
kernel private dependencies. This patch fixes compilation errors in
standalone veristat.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
---
 tools/testing/selftests/bpf/veristat.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index 09cfbd486f92..d532dd82a3a8 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -23,6 +23,7 @@
 #include <float.h>
 #include <math.h>
 #include <limits.h>
+#include <assert.h>
 
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -239,7 +240,7 @@ static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va
 
 #define log_errno(fmt, ...) log_errno_aux(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
 
-__printf(3, 4)
+__attribute__((format(printf, 3, 4)))
 static int log_errno_aux(const char *file, int line, const char *fmt, ...)
 {
 	int err = -errno;
@@ -1337,7 +1338,7 @@ static bool output_stat_enabled(int id)
 	return false;
 }
 
-__printf(2, 3)
+__attribute__((format(printf, 2, 3)))
 static int write_one_line(const char *file, const char *fmt, ...)
 {
 	int err, saved_errno;
@@ -1358,7 +1359,7 @@ static int write_one_line(const char *file, const char *fmt, ...)
 	return err < 0 ? -1 : 0;
 }
 
-__scanf(3, 4)
+__attribute__((format(scanf, 3, 4)))
 static int scanf_one_line(const char *file, int fields_expected, const char *fmt, ...)
 {
 	int res = 0, saved_errno = 0;
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-02 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 17:56 [PATCH bpf-next v2] selftests/bpf: allow veristat compile standalone Mykyta Yatsenko
2025-07-02 18:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox