[ntp:questions] Re: Factoring/simplifying the sources

Brian Inglis Brian.Inglis at SystematicSW.Invalid
Sat Sep 9 21:42:20 UTC 2006


On Sat, 9 Sep 2006 18:24:18 GMT in comp.protocols.time.ntp,
philipp_subx at redfish-solutions.com (Philip Prindeville) wrote:

>Also, what cross-reference tools can be scripted to find duplicate
>function definitions and declarations (and maybe macros as well)
>so we can reduce the number of duplications of code?  Cscope?
>xref?  Is there a preferred methodology?

[ec]*tags would probably be adequate for finding duplicates. 
For ctags, -d adds #defines, -T adds typedefs and tags; -v vgrind or
-x cxref output formats may be easier to work with. 
I've use cxref to help clean up code before major surgery; presumably
cscope would work as well. 

With (suspected) dead code, I first put it inside #if 0...#endif,
check it still compiles and passes tests, check in the source, delete
the conditional code, check it still compiles and passes tests, check
in the source again; saves having to revert deleted code if you
misjudge. 

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian.Inglis at CSi.com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply




More information about the questions mailing list