gcc Pre-processor information

Ian Lance Taylor iant@google.com
Fri May 6 13:30:00 GMT 2011


ankit7777 <baid4758@gmail.com> writes:

> Problem Statement : Given a C file which has several macros defined (eg.
> #define MACRO 10) . I need to know what all macros are defined and their
> usage point(eg. line number) in the code. 
>
> Need to know this information during or after gcc pre-processing phase. 
>
> Possible solution may dump this macro information in some file. 
>
> Is there any way that gcc can dump this information and if yes how?

Look at the implementation of -dD and the implementation of -g3.  gcc
does have this information, though it may not be in a particularly
convenient form.

Ian



More information about the Gcc mailing list