Re: [PATCH 3/8] bpftool: Conditionally add -Wformat-signedness flag
From: Leo Yan
Date: Thu Sep 25 2025 - 08:43:34 EST
On Thu, Sep 25, 2025 at 11:42:39AM +0100, Quentin Monnet wrote:
> 2025-09-25 11:26 UTC+0100 ~ Leo Yan <leo.yan@xxxxxxx>
> > clang-18.1.3 on Ubuntu 24.04.2 reports warning:
> >
> > warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
> >
> > Conditionally add the option only when it is supported by compiler.
> >
> > Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
>
>
> Hi, how annoying is this warning?
Not too bad, it prints out 5~6 times warnings (see the build log below).
Though the warnings are a bit noisy, they does not break the build.
> I'm asking because as far as I
> understand, the option has been introduced in LLVM 19.1.0 [0] - the
> latest being 21.1.0 already - so we won't need this check once distros
> have transitioned, and I'm a bit reluctant to add it.
I agree the warning likely won't affect distros, as package maintainers
will hide it. But it can annoy _paranoid_ developers in day-to-day
builds ;)
As the warning doesn't block anything, so I am fine with not merging
this patch.
Thanks,
Leo
> [0]
> https://github.com/llvm/llvm-project/commit/ea92b1f9d0fc31f1fd97ad04eb0412003a37cb0d
---8<---
Auto-detecting system features:
... clang-bpf-co-re: [ on ]
... llvm: [ OFF ]
... libcap: [ on ]
... libbfd: [ OFF ]
... libbfd-liberty: [ OFF ]
... libbfd-liberty-z: [ OFF ]
... disassembler-four-args: [ OFF ]
... disassembler-init-styled: [ OFF ]
... libelf-zstd: [ o
MKDIR /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf
MKDIR /build/util/bpf_skel/.tmp/bootstrap/libbpf/
MKDIR /build/util/bpf_skel/.tmp/bootstrap/
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/hashmap.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/relo_core.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_internal.h
warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
1 warning generated.
GEN /build/util/bpf_skel/.tmp/bootstrap/libbpf/bpf_helper_defs.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_legacy.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/btf.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helpers.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_common.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_tracing.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_core_read.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_endian.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_version.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/skel_internal.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/usdt.bpf.h
INSTALL /build/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helper_defs.h
INSTALL libbpf_headers
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/nlattr.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_errno.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/str_error.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/netlink.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_probes.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/hashmap.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_dump.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ringbuf.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/strset.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/gen_loader.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/relo_core.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/linker.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/usdt.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/zip.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/elf.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/features.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_iter.o
CC /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_relocate.o
LD /build/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf-in.o
LINK /build/util/bpf_skel/.tmp/bootstrap/libbpf/libbpf.a
CC /build/util/bpf_skel/.tmp/bootstrap/main.o
CC /build/util/bpf_skel/.tmp/bootstrap/common.o
CC /build/util/bpf_skel/.tmp/bootstrap/json_writer.o
CC /build/util/bpf_skel/.tmp/bootstrap/gen.o
CC /build/util/bpf_skel/.tmp/bootstrap/btf.o
warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]warning:
unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
warning: unknown warning option '-Wformat-signedness' [-Wunknown-warning-option]
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
LINK /build/util/bpf_skel/.tmp/bootstrap/bpftool