This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc able to output identifiers?
- From: Ian Lance Taylor <iant at google dot com>
- To: Rainer Hochschild <RainerHochschild at web dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 07 May 2009 21:32:39 -0700
- Subject: Re: gcc able to output identifiers?
- References: <600935682@web.de>
Rainer Hochschild <RainerHochschild@web.de> writes:
> Is there a way that will make gcc provide me with a list of all
> (C/C++) identifiers used in the source code (i.e. all variables,
> constants, functions, methods, classes, macros etc.). My intention is
> to check this output against some regular expressions to identify
> violations against naming conventions.
The compiler has no option to produce a complete list. There are
various approaches you can take to get this information, though I'm not
sure that any of them are guaranteed 100% complete. For example, you
could look at the debugging information.
> Or is there some other way to check the source code for compliance to
> user-specified naming conventions using a tool from the gcc suite?
In current development gcc, not yet released, you might be able to write
a plugin for this. http://gcc.gnu.org/wiki/plugins .
Ian