[DTrace-devel] [PATCH 2/3] Ignore "discarded qualifier" compile warnings with old bpf.h

eugene.loh at oracle.com eugene.loh at oracle.com
Thu Nov 30 02:43:58 UTC 2023


From: Eugene Loh <eugene.loh at oracle.com>

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 bpf/Build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bpf/Build b/bpf/Build
index 917e8a0e..3279f427 100644
--- a/bpf/Build
+++ b/bpf/Build
@@ -48,6 +48,11 @@ bpf_dlib_SOURCES = \
 	strtok.S \
 	substr.S
 
+# Older linux/bpf.h omit the const qualifier to key and value parameters
+# in bpf_map_[lookup|update|delete]_elem() calls.  Ignore related warnings.
+get_agg.c_CFLAGS := -Wno-discarded-qualifiers
+get_dvar.c_CFLAGS := -Wno-discarded-qualifiers
+
 bpf-check: $(objdir)/include/.dir.stamp
 	$(BPFC) $(BPFCPPFLAGS) $(bpf_dlib_CPPFLAGS) $(BPFCFLAGS) -S \
 		-o - bpf/get_bvar.c | \
-- 
2.18.4




More information about the DTrace-devel mailing list