On 8/9/21 6:44 PM, Segher Boessenkool wrote:
This is not a documented GCC extension either, and it might even conflict with the existing void * extension (allowing arithmetic on it, by defining sizeof(void)). In either case it is not currently defined.
I'm not sure how you get to this, but all we're doing here is standard C. x.c: char foo (const void *x) { const char *y = (const char *) x; return *y; } y.c: void foo (const void *x, char c) { const char *y = (const char *) x; *y = c; } wschmidt@rain6p1:~/src$ gcc -c x.c wschmidt@rain6p1:~/src$ gcc -c y.c y.c: In function 'foo': y.c:5:6: error: assignment of read-only location '*y' *y = c; ^ wschmidt@rain6p1:~/src$