Re: I don't understand why the compiler does this.
- From: blr@xxxxxxxxxxxxxxxxxxxx (Brian Raiter)
- Date: Mon, 9 Jan 2006 21:39:02 +0000 (UTC)
> However, when I insert a breakpoint at the line
> I don't get this error. Why is this?
The more technical explanation is that, in order to insert a
breakpoint, the debugger has to modify your code. Thus the page of
memory that contained your code, and your string, was changed to be
writeable at that point.
But, again, the direct explanation is that your code involved
undefined behavior, thus giving the compiler complete freedom in what