Commit ab21cf8
libbpf: Fix -Wdiscarded-qualifiers under C23
commit d70f79f upstream.
glibc ≥ 2.42 (GCC 15) defaults to -std=gnu23, which promotes
-Wdiscarded-qualifiers to an error.
In C23, strstr() and strchr() return "const char *".
Change variable types to const char * where the pointers are never
modified (res, sym_sfx, next_path).
Suggested-by: Florian Weimer <[email protected]>
Suggested-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Mikhail Gavrilov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
[ shung-hsi.yu: needed to fix kernel build failure due to libbpf since glibc
2.43+ (which adds 'const' qualifier to strstr) ]
Signed-off-by: Shung-Hsi Yu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent f749b36 commit ab21cf8
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8245 | 8245 | | |
8246 | 8246 | | |
8247 | 8247 | | |
8248 | | - | |
| 8248 | + | |
8249 | 8249 | | |
8250 | 8250 | | |
8251 | 8251 | | |
| |||
11574 | 11574 | | |
11575 | 11575 | | |
11576 | 11576 | | |
11577 | | - | |
| 11577 | + | |
| 11578 | + | |
11578 | 11579 | | |
11579 | 11580 | | |
11580 | 11581 | | |
| |||
12159 | 12160 | | |
12160 | 12161 | | |
12161 | 12162 | | |
12162 | | - | |
| 12163 | + | |
12163 | 12164 | | |
12164 | 12165 | | |
12165 | 12166 | | |
| |||
0 commit comments