–Challenge: scan a c++ codebase for a given func name
- A script would offer more flexibility.
- find + perl + grep is a crude solution, without support for comments
See also the task in Outlook!
–A related challenge: suppose you have the definition of a function, how do you see all the callers?
- Technique using compiler warning — http://stackoverflow.com/questions/1140509/how-to-find-all-callers-of-a-function-in-c . Tested: able to report the line number of caller:
Csmi.C: In static member function ‘static csmiparser::Csmi& csmiparser::Csmi::getInstance()’:
Csmi.C:14: warning: ‘__comp_ctor ’ is deprecated (declared at /home/vtan/tp/plugins/xtap/csmi/include/Csmi.h:33)
- Technique — Rename the by appending _xxx and rebuild