Commit f98b7bc
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 03e2ed2 commit f98b7bc
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 | | |
| |||
11820 | 11820 | | |
11821 | 11821 | | |
11822 | 11822 | | |
11823 | | - | |
| 11823 | + | |
11824 | 11824 | | |
11825 | 11825 | | |
11826 | 11826 | | |
| |||
12406 | 12406 | | |
12407 | 12407 | | |
12408 | 12408 | | |
12409 | | - | |
| 12409 | + | |
12410 | 12410 | | |
12411 | 12411 | | |
12412 | 12412 | | |
| |||
0 commit comments