Re: casting const away





"copx" wrote in message news:ig3l22$3hb$1@xxxxxxxxxxxxxxxxxxxx Here's some compile-ready code which illustrates the issue:

#include <stdio.h>

void foo(const int *c)
{
*((int *)c) = 'B';
}


int main(void)
{
int a = 'A';
foo(&a);
putchar(a);
return 0;
}


====
Result: no warnings, prints 'B';

As I wrote in the other post I think I have figured it out
already.





.