Re: Clang analysis: Debug variables "never read."
Re: Clang analysis: Debug variables "never read."
- Subject: Re: Clang analysis: Debug variables "never read."
- From: Rick Mann <email@hidden>
- Date: Fri, 2 Oct 2009 10:04:59 -0700
On Oct 2, 2009, at 09:57:48, Fritz Anderson wrote:
I have a lot of code that assigns diagnostic information (error
codes, strings) to local variables for the sole purpose of making
that information visible in the debugger.
- (void) wrapSomethingComplicated
{
MyObject * localStuff;
// Lots of prep work going into localStuff
/// ...
int errorCode = [self doSomethingComplicated: localStuff];
[localStuff tearDown];
}
When I select Build > Build and Analyze in Xcode 3.2, the analyzer
issues lots of issues of the form "Value stored to 'errorCode' is
never read." This is correct, as far as it goes, but the non-use is
intentional.
Okay, in principle, I don't know that _all_ warnings flag
_intentional_ non-uses of a variable. So what's the best way for me
to mark up the intentional uses so they don't clutter the results?
What happens if you add line like
(void) localStuff;
or even just
localStuff;
after you write to it (or probably anywhere after you declare it)?
--
Rick
_______________________________________________
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