• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identifying Dead Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying Dead Code


  • Subject: Re: Identifying Dead Code
  • From: Dmitry Markman <email@hidden>
  • Date: Fri, 22 Jun 2012 22:46:55 -0400

did you try gcov?

I'm not sure clang has similar tool

see

http://permalink.gmane.org/gmane.comp.compilers.clang.devel/21158

here

http://stackoverflow.com/questions/5852002/xcode-code-coverage

you can see that LLVM has gcov support, but I'm not sure if Apple clang has it

 dm




On Jun 20, 2012, at 7:10 PM, Jens Alfke wrote:

>
> 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

Dmitry Markman


 _______________________________________________
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


  • Follow-Ups:
    • Re: Identifying Dead Code
      • From: Dmitry Markman <email@hidden>
References: 
 >Re: Identifying Dead Code (From: Gordon Apple <email@hidden>)
 >Re: Identifying Dead Code (From: Jens Alfke <email@hidden>)

  • Prev by Date: another wack warning courtesy of Xcode 4.3
  • Next by Date: Re: Identifying Dead Code
  • Previous by thread: Re: Identifying Dead Code
  • Next by thread: Re: Identifying Dead Code
  • Index(es):
    • Date
    • Thread