This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Audit Use of Global Variables in C++ Shared Object (GCC Warning?)
- From: Jeffrey Walton <noloader at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 19 Oct 2010 17:20:59 -0400
- Subject: Audit Use of Global Variables in C++ Shared Object (GCC Warning?)
- Reply-to: noloader at gmail dot com
Hi All,
I'm interested in finding references to global variables in a compilation unit.
I've found "nm [-D] ..." is helpful for archives and shared objects,
but its only useful if combined with grep and variable naming
conventions. For example, if naming conventions are punned, then "nm
-D mycoollib | grep g_" is useless.
Does gcc have such a warning? Does anyone have tricks for auditing
the use of globals?
Jeff