Re: casting const away
- From: "copx" <copx@xxxxxxxxx>
- Date: Thu, 6 Jan 2011 11:53:23 +0100
"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.
.
- Follow-Ups:
- Re: casting const away
- From: Kelsey Bjarnason
- Re: casting const away
- From: Alan Curry
- Re: casting const away
- From: lawrence . jones
- Re: casting const away
- References:
- casting const away
- From: copx
- casting const away
- Prev by Date: Re: lccwin fails to generate NOPs
- Next by Date: Re: strtoul() behavior
- Previous by thread: Re: casting const away
- Next by thread: Re: casting const away
- Index(es):
Relevant Pages
|