public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc Pre-Processing Information
@ 2011-05-06 11:22 ankit7777
  2011-05-06 15:16 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: ankit7777 @ 2011-05-06 11:22 UTC (permalink / raw)
  To: gcc-help


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?
-- 
View this message in context: http://old.nabble.com/gcc-Pre-Processing-Information-tp31557981p31557981.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc Pre-Processing Information
  2011-05-06 11:22 gcc Pre-Processing Information ankit7777
@ 2011-05-06 15:16 ` Jonathan Wakely
  2011-05-09  4:08   ` ankit7777
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2011-05-06 15:16 UTC (permalink / raw)
  To: ankit7777; +Cc: gcc-help

On 6 May 2011 12:21, ankit7777 <baid4758@gmail.com> wrote:
>
> 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?


gcc -E -dD source.c | grep MACRO

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc Pre-Processing Information
  2011-05-06 15:16 ` Jonathan Wakely
@ 2011-05-09  4:08   ` ankit7777
  0 siblings, 0 replies; 3+ messages in thread
From: ankit7777 @ 2011-05-09  4:08 UTC (permalink / raw)
  To: gcc-help


Hi Jonathan , The problem is that i do not have the list of macros with me ,
so using grep is not going to work . .  and also I need the line number
where it is resolved in source code(Even if i  try to grep for known macros
, it will not be possible because they get resolved).


Jonathan Wakely-4 wrote:
> 
> On 6 May 2011 12:21, ankit7777 <baid4758@gmail.com> wrote:
>>
>> 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?
> 
> 
> gcc -E -dD source.c | grep MACRO
> 
> 

-- 
View this message in context: http://old.nabble.com/gcc-Pre-Processing-Information-tp31557981p31573898.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-09  4:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 11:22 gcc Pre-Processing Information ankit7777
2011-05-06 15:16 ` Jonathan Wakely
2011-05-09  4:08   ` ankit7777

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).