C/C++: list of macro definitions?

Neil Booth neil@daikokuya.co.uk
Thu Nov 7 12:04:00 GMT 2002


Neil Booth wrote:-

> > Is there a way to dump out only the UTILIZED (ones that are expanded 
> > somewhere) macros?
> 
> No.  -Wunused-macros does a bit of the reverse; it tells you which
> ones were unused that were also defined in the main file.  3.3 only.
> 
> > And can it display where (file & line) the expansion occurs?
> 
> No.

If you're wanting to catch all uses of an identifier that you don't
want to be used (I'm guessing what you really are trying to do here),
#pragma GCC poison ident_a ident_b ident_c
might do what you want.

Neil.



More information about the Gcc-help mailing list