4

Possible Duplicate:
gcc preprocessor output

For some reason I need to investigate some .i files generated by g++ preprocessor, where I see code like this:

#1  /usr/local/include/boost/python.hpp 1 3
#11  /usr/local/include/boost/python.hpp 3

I'm an experienced C++ programmer and I know what .i file is, the problem is, I can't find a detailed explanation on how to interpret the lines in .i file.

Can someone explain what the above lines mean (especially what the numbers following the files ) or point me a place where I can find some document about this?


Thanks, after looking at the link, my problem solved. I'd like to add some background in case somebody else see the same problem. My project uses a strict compiler check, i.e., g++ -Wall -Werror. All warnings are treated as errors. And we are using boost.python, before yesterday, boost was put in /usr/local/include, and the compilation is fine. Then we decide to move boost into our source control for easier upgrade, and a warning (treated as error) arise.

So after the investigation and the details from the link given by CrazyCasta, the problem is actually this: when boost is in /usr/local/include, it is treated as a system header, so gcc supresses some warnings; while we move boost out, gcc is not that tolerable to it.

Basically, just ignore or supress that warning by hand.

Community
  • 1
  • 1
Ralph Zhang
  • 5,015
  • 5
  • 30
  • 40

1 Answers1

3

Your answer can be found here.

Basically it's remapping the line number/filename space of the input so the compiler knows where lines came from. The first number is the line number of where the source came from, the filename after that is the file it came from. The numbers thereafter are flags.

CrazyCasta
  • 26,917
  • 4
  • 45
  • 72