mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 22:15:13 +08:00
libbpf: fix clang warning about format non-literal
Add format attribute to the format string in print routines. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
parent
5632cf69ad
commit
bf71c8f214
@ -23,12 +23,14 @@
|
||||
|
||||
#include "bpf_util.h"
|
||||
|
||||
static int verbose_print(enum libbpf_print_level level, const char *format, va_list args)
|
||||
static int __attribute__((format(printf, 2, 0)))
|
||||
verbose_print(enum libbpf_print_level level, const char *format, va_list args)
|
||||
{
|
||||
return vfprintf(stderr, format, args);
|
||||
}
|
||||
|
||||
static int silent_print(enum libbpf_print_level level, const char *format, va_list args)
|
||||
static int __attribute__((format(printf, 2, 0)))
|
||||
silent_print(enum libbpf_print_level level, const char *format, va_list args)
|
||||
{
|
||||
if (level > LIBBPF_WARN)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user