amd,compiler: fix const errors found with C23 glibc support

In glibc 2.43 the strstr function now propagate const to the output, triggering -Wincompatible-pointer-types-discards-qualifiers
under clang/gcc with -Werror.

Fix two of these cases by adding the const qualifier.

cc: mesa-stable

(cherry picked from commit ece5f671b3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39828>
This commit is contained in:
Reilly Brogan 2026-02-08 13:02:07 -06:00 committed by Marge Bot
parent a871c42e39
commit 66cd1f224c
2 changed files with 3 additions and 3 deletions

View file

@ -1324,7 +1324,7 @@
"description": "amd,compiler: fix const errors found with C23 glibc support",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -390,8 +390,8 @@ static void
radv_add_split_disasm(const char *disasm, uint64_t start_addr, unsigned *num, struct radv_shader_inst *instructions)
{
struct radv_shader_inst *last_inst = *num ? &instructions[*num - 1] : NULL;
char *next;
char *repeat = strstr(disasm, "then repeated");
const char *next;
const char *repeat = strstr(disasm, "then repeated");
while ((next = strchr(disasm, '\n'))) {
struct radv_shader_inst *inst = &instructions[*num];