Instead of rather euphemistic struct cast, just reomve the const qualifier and assign directly. According to ISO/IEC 9899:2018 section 6.5 paragraph 7, VALUE and const VALUE are allowed to alias (but two distinct structs are not, even when their structures are the same). [Bug #17540]
Related issues
Bug #17540: A segfault due to Clang/LLVM optimization on 32-bit ARM Linux
RBASIC_SET_CLASS_RAW: follow strict aliasing rule
Instead of rather euphemistic struct cast, just reomve the const
qualifier and assign directly. According to ISO/IEC 9899:2018 section
6.5 paragraph 7,
VALUEandconst VALUEare allowed to alias (but twodistinct structs are not, even when their structures are the same).
[Bug #17540]