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

- From: Florian Weimer \<hidden\>
- Date: 2025-11-28 13:38:26 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/11/7940340
- Thread: https://ratatoskr.run/bpf/2025/11/7940340/t.md

```text
* Mikhail Gavrilov:

> - 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

```
