llvmpipe/lp_state_cs.c:1398:41: error: passing 'const void *const' to parameter of type 'void *' discards qualifiers
System information
- OS: Ubuntu 21.10 impish
- Mesa version:
main
- LLVM:
master
- Clang:
master
Describe the issue
I get the error while building rusticl/wip
(!15439 (merged)) branch but the bug lies in a file from main
not touched by this branch.
../src/gallium/drivers/llvmpipe/lp_state_cs.c:1398:41: error: passing 'const void *const' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
llvmpipe_cs_update_derived(llvmpipe, info->input);
^~~~~~~~~~~
../src/gallium/drivers/llvmpipe/lp_state_cs.c:1278:69: note: passing argument to parameter 'input' here
llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe, void *input)
I compile Mesa using latest LLVM/Clang I built.
I use my user-rusticl
build script to build LLVM, Clang and Mesa using the rusticl/wip
branch (see !15439 (merged)).
For some unknown reason when I build Mesa using my user-mesa
build script (main
) branch I don't get the error but the rusticl/wip
branch is just based on main
and doesn't modify this file. When I build the whole Mesa from main
I enable more Mesa component so maybe there is a side effect in disabling or enabling components?
In all case the problematic code lives in main
branch.
I noticed such workaround makes the build continue but this is just hiding the problem:
diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c
index 230004d799f..ebb6d1288dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_cs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c
@@ -1395,7 +1395,7 @@ static void llvmpipe_launch_grid(struct pipe_context *pipe,
memset(&job_info, 0, sizeof(job_info));
- llvmpipe_cs_update_derived(llvmpipe, info->input);
+ llvmpipe_cs_update_derived(llvmpipe, (void *) info->input);
fill_grid_size(pipe, info, job_info.grid_size);