Re: Variable evaluating improperly
Re: Variable evaluating improperly
- Subject: Re: Variable evaluating improperly
- From: Seth Willits <email@hidden>
- Date: Tue, 30 Apr 2013 12:29:12 -0700
On Apr 30, 2013, at 11:36 AM, koko wrote: Compilers often optimize flow of control statements in non-obvious ways (especially if the conditional _expression_ is a compile time constant as it in your case). This can lead to misleading or even impossible seeming representations in debugger windows. Insert a printf statement to see if you really get into the then clause. Of course, this might also completely change any optimization rearrangements. All very Heisenbergian.
In this case the above appears to be the case as I was running with the Release configuration. Switching to Debug config it all looks well … but here is the kicker my Release build that is being purchased exhibits this behavior … !
Your code is running fine so there's no need to really worry. When it's just the debugger / Xcode that's displaying the wrong value it happens infrequently but it's a nuisance for sure. The only thing to do is try to find some way to reproduce it and file a bug on lldb and/or Xcode. I've had cases where Xcode shows a variable's value as A, 'print' in the debugger console shows it as B, and printf() in code shows it as C.
In the past at least, when using gdb you generally won't see this problem but it can still happen. With lldb it happens far less frequently than it used to.
|
_______________________________________________
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