Re: [PATCH v2 bpf-next] tools/lib/bpf: fix -Wdiscarded-qualifiers under C23

Started by Florian Weimer on Nov 28, 2025

open the first message on its own page

Message details and related content
* Mikhail Gavrilov:
quoted hunk
- Use explicit casts instead of changing variable types to const char *,
  because the variables are already declared as char * earlier in the
  functions and used in contexts requiring mutability.
  This is common practice in the kernel when full const-correctness
  cannot be preserved without major refactoring.
What kind of mutability is this about?  Obviously char *const won't
work, but const char * seems to be fine for these variables?

Thanks,
Florian
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help