Skip to content

Using the right format specifiers for bpftool

Jiayuan Chen bpf lkml 1 version Applied

Status from this message: This patch was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 4 repliesApplied 1/1

Patches in v1 All 1 applied

#Subject and filesSizeRepliesApplied
1/1bpftool: Using the right format specifierstools/bpf/bpftool/gen.c tools/bpf/bpftool/link.c tools/bpf/bpftool/main.c +1 more+22 -221 replyApplied

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchQuentin Monnet
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next v1 0/1] Using the right format specifiers for bpftool

Fixed some incorrect formatting specifiers that were exposed when I added the "-Wformat" flag to the compiler options.

This patch doesn't include "-Wformat" in the Makefile for now, as I've only addressed some obvious semantic issues with the compiler warnings. There are still other warnings that need to be tackled.

For example, there's an ifindex that's sometimes defined as a signed type and sometimes as an unsigned type, which makes formatting a real pain
- sometimes it needs %d and sometimes %u. This might require a more fundamental fix from the variable definition side.

If the maintainer is okay with adding "-Wformat" to the tools/bpf/bpftool/Makefile, please let us know, and we can follow up with further fixes.

Jiayuan Chen (1):
bpftool: Using the right format specifiers

 tools/bpf/bpftool/gen.c  | 12 ++++++------
 tools/bpf/bpftool/link.c | 14 +++++++-------
 tools/bpf/bpftool/main.c |  8 ++++----
 tools/bpf/bpftool/map.c  | 10 +++++-----
 4 files changed, 22 insertions(+), 22 deletions(-)
Signature · 1 line
2.43.5