Re: Identifying Dead Code
Re: Identifying Dead Code
- Subject: Re: Identifying Dead Code
- From: Jens Alfke <email@hidden>
- Date: Wed, 20 Jun 2012 16:10:23 -0700
On Jun 20, 2012, at 3:20 PM, Gordon Apple wrote:
> Well, if it’s commented out, it’s obviously not getting called. Yes, I mean live code, methods, etc, that nobody calls. Sometimes I might leave something in, just in case I want it later, but I’m mostly talking about code that has been replaced or rendered unneeded. Many times, I comment something out just to see who, if anybody, complains. That takes a lot of time if there are a lot of code to be checked. It would be a lot easier if xcode could identify unreachable code, and let me decide whether or not to zap it.
Well, there's an optional warning for unused static functions, that you can enable.
Beyond that, I don't know of any automated checks. The linker will dead-strip unreachable functions, but I don't know if there's a way to have it report what it stripped.
Also, what language is this? It's fairly easy to tell if C functions are unreachable, but difficult with C++ virtual methods, and impossible with Objective-C methods (since any method is callable even if its selector never appears in the source code; after all, that kind of thing happens all the time when nibs are loaded.)
—Jens
_______________________________________________
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