Closed
Description
static void function2(int *a) {
const int *b = a;
}
static void function(const int *a) {
function2((int *)a);
}
const a: c_int = 0;
function(&a);
/home/tdeo/.cache/zig/stage1/o/.../cimport.zig:7:15: error: cast discards const qualifier
function2(@ptrCast([*c]c_int, @alignCast(@alignOf(c_int), a)));
Motivation: Wayland add_listener functions cast their struct of function pointer arguments to void (**)(void)
before passing them to another function, which then stores it in a const field and never modifies through it.