From 85fd63068e91d0dd4b9434831ddddbbc2ff07355 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 7 Feb 2026 22:02:23 -0800 Subject: [PATCH] compiler/clc: Fix const correctness in libclc_add_generic_variants Fix compiler error: ../src/compiler/clc/nir_load_libclc.c:266:13: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] 266 | char *U3AS1 = strstr(func->name, "U3AS1"); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ glibc now provides C23-style type-generic string functions. strstr returns const char * when passed a const char * argument. Update U3AS1 declaration to const since it's only used for offset calculation. Fixes: 4a08ee7ecf0 ("spirv/libclc: Add generic versions of arithmetic functions") Signed-off-by: Vinson Lee Reviewed-by: Karol Herbst Part-of: --- src/compiler/clc/nir_load_libclc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/clc/nir_load_libclc.c b/src/compiler/clc/nir_load_libclc.c index 8c51aaf776d..48668eaec0f 100644 --- a/src/compiler/clc/nir_load_libclc.c +++ b/src/compiler/clc/nir_load_libclc.c @@ -263,7 +263,7 @@ libclc_add_generic_variants(nir_shader *shader) if (strstr(func->name, "async_work_group_strided_copy")) continue; - char *U3AS1 = strstr(func->name, "U3AS1"); + const char *U3AS1 = strstr(func->name, "U3AS1"); if (U3AS1 == NULL) continue;