Re: Can never debug Release Build Configuration
Re: Can never debug Release Build Configuration
- Subject: Re: Can never debug Release Build Configuration
- From: Stefan Werner <email@hidden>
- Date: Thu, 19 Apr 2007 15:23:00 -0700
On 19.04.2007, at 15:05, Jack Repenning wrote:
Well, once (in 25 years) I have seen a bug that really "turned on
and off" depending on whether the code was optimized (not counting
timing bugs, which can have that behavior but are also likely to
happen the other way, just less often). As it happens, this bug
only caused problems in the debug code: the optimizer actually
fixed the bug!
So it does happen.
Not very often.
The problem: there was a stack variable that was uninitialized
along some code paths, and trivially initialized along some others;
the optimizer correctly inferred that there was no *harm* in
pulling that initialization up out of a loop construct where it had
been coded, and actually doing it during the preamble of the
procedure, so that's what it did!
Which is why we all must pay attention to the warnings the compilers
throw. There's a reason why they warn you.
Not to say that compilers are perfect and all-knowing - but I know
that the ones who wrote the compiler know more about C, C++ and
Objective-C than I do.
Going back to the original question - not being able to debug the
release build: one thing that can confuse one in Xcode is that build
settings can be set on different levels. Make sure that the build
options are set correctly on _target_ level - things that you specify
on _project_ level may not apply. Also check that the files in
question don't have any individual compiler flags.
-Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden