What you need would be the software tool for
static code analysis working with the source C code:
http://en.wikipedia.org/wiki/Static_code_analysis[
^].
You can review this list:
http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#C.2FC.2B.2B[
^].
You can get familiar with some or each of those tools and choose what could work for you; some of them are open-source.
And I would wish you to "have" only the projects which don't require much of such analysis, due to strict architecture and neat implementation. In particular, global variables is generally a bad thing, a sign of bad code and project design. It's quite possible to avoid them or at least minimize.
—SA