From e9afaaeaacdba5bab2ddda4293106a0278d13f80 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 21 Apr 2026 20:31:34 +0000 Subject: [PATCH] bpf: suppress false-positive clang-tidy/clangd diagnostics under src/bpf clang-tidy's misc-use-internal-linkage fires on BPF map declarations (they have the SEC(".maps") attribute and must retain external linkage so bpftool gen skeleton can resolve them as ELF symbols), and its misc-include-cleaner flags errno.h as unused even where a /* IWYU pragma: keep */ is present. clangd's own unused-includes analysis emits the equivalent diagnostic independently of clang-tidy. Add src/bpf/.clang-tidy and src/bpf/.clangd that inherit the parent configs and scope these suppressions to BPF sources only. --- src/bpf/.clang-tidy | 7 +++++++ src/bpf/.clangd | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 src/bpf/.clang-tidy create mode 100644 src/bpf/.clangd diff --git a/src/bpf/.clang-tidy b/src/bpf/.clang-tidy new file mode 100644 index 0000000000..43b0c59f49 --- /dev/null +++ b/src/bpf/.clang-tidy @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +--- +InheritParentConfig: true +Checks: '-misc-use-internal-linkage' +CheckOptions: + misc-include-cleaner.IgnoreHeaders: 'errno\.h' +... diff --git a/src/bpf/.clangd b/src/bpf/.clangd new file mode 100644 index 0000000000..ec2f81817b --- /dev/null +++ b/src/bpf/.clangd @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +Diagnostics: + Includes: + IgnoreHeader: [errno\.h]