mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-12 13:20:33 +01:00
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: 4a08ee7ecf ("spirv/libclc: Add generic versions of arithmetic functions")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39761>
This commit is contained in:
parent
4938ad435e
commit
85fd63068e
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue