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
> manip("thisisbad");
>
> [...]
>
> 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
it produced.
b
.
- References:
- Prev by Date: Re: Solaris gcc structure alignment
- Next by Date: Re: "connect'" returns before server "accept"s
- Previous by thread: Re: I don't understand why the compiler does this.
- Next by thread: I don't understand why the compiler does this.
- Index(es):
Relevant Pages
|