Commit 313e3be
tools/lib/bpf: fix -Wdiscarded-qualifiers under C23
glibc ≥ 2.42 (GCC 15) defaults to -std=gnu23, which promotes
-Wdiscarded-qualifiers to an error in the default hardening flags
of Fedora Rawhide, Arch Linux, openSUSE Tumbleweed, Gentoo, etc.
In C23, strstr() and strchr() return "const char *" in most cases,
making previous implicit casts invalid.
This breaks the build of tools/bpf/resolve_btfids on pristine
upstream kernel when using GCC 15 + glibc 2.42+.
Fix the three remaining instances with explicit casts.
No functional changes.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2417601
Suggested-by: Florian Weimer <[email protected]>
Signed-off-by: Mikhail Gavrilov <[email protected]>1 parent f015201 commit 313e3be
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8484 | 8484 | | |
8485 | 8485 | | |
8486 | 8486 | | |
8487 | | - | |
| 8487 | + | |
8488 | 8488 | | |
8489 | 8489 | | |
8490 | 8490 | | |
| |||
11822 | 11822 | | |
11823 | 11823 | | |
11824 | 11824 | | |
11825 | | - | |
| 11825 | + | |
11826 | 11826 | | |
11827 | 11827 | | |
11828 | 11828 | | |
| |||
12410 | 12410 | | |
12411 | 12411 | | |
12412 | 12412 | | |
12413 | | - | |
| 12413 | + | |
12414 | 12414 | | |
12415 | 12415 | | |
12416 | 12416 | | |
| |||
0 commit comments