Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] How difficult is it to find dead code

 Well, you can recompile the code with the profile flag (-pg).  Then run the program.  It will create a file in the current directory called gmon.out.

Then, run "gprof progra," (whatever program executable you called in the first step).  Uncalled subroutines and functions will not appear in the call list at the top.

Finding dead code INSIDE subroutines and functions is a bit harder.

-Jack

----------------------------------------------------------------------

Message: 1
Date: Mon, 29 Jul 2013 10:12:04 -0700 (PDT)
From: Carl Slater <ce.slater@xxxxxxxxx>
To: "photran@xxxxxxxxxxx" <photran@xxxxxxxxxxx>
Subject: [photran] How difficult is it to find dead code
Message-ID:
<1375117924.87392.YahooMailNeo@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"

Hmmm I was thinking ... I know dangerous.

You have a database of function definitions and function usages .... how hard is it to identify routines that are never used?

When you inherit a code worked on by multiple authors it is easy to have "dead code" that gets updated but never used.

Regards
Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/photran/attachments/20130729/0b7c9ad0/attachment.html>

------------------------------

_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/photran


End of photran Digest, Vol 95, Issue 10
***************************************

Back to the top