1829958 Members
1980 Online
109998 Solutions
New Discussion

aCC preprocessor command

 
Ryan Keith
New Member

aCC preprocessor command

aCC -E gives all the preprocessor commands, is there a command to add to just give like the first header file?

thx
3 REPLIES 3
Mike Stroyan
Honored Contributor

Re: aCC preprocessor command

I'm not sure I understand what you are asking for. If you want to know which header files are used by a compilation, you could grep for the lines that show the header file names.

aCC -E prog.cpp | grep '^#line 1 '

This more complicated filter will indent based on how many includes deep the header file is.

awk '/^#line.*"/{if($2==1){printf "%"i"s%s\n"," ",$NF;i+=1}else{i-=1}}'
Ryan Keith
New Member

Re: aCC preprocessor command

yeah that works, thx
Dennis Handly
Acclaimed Contributor

Re: aCC preprocessor command

>This more complicated filter will indent based on how many includes deep the header file is.

 

The -H option was added to write include info to stderr.