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

Kris Van Hees kris.van.hees at oracle.com
Thu Nov 30 04:56:10 UTC 2023


On Wed, Nov 29, 2023 at 09:43:58PM -0500, eugene.loh--- via DTrace-devel wrote:
> 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.

But that should not be a problem because we compile with our own copy of
bpf.h.  Unless somehow the BPF precompilation is pickup up the wrong bpf.h.
It should be using the one in include/linux/bpf.h in the DTrace source tree.

> +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
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list