3

GCC's documentation for #line directives says that they are like this:

#line "myfile.cpp" 123

But when I check the output with g++ 5.1 they actually come out like this:

# 1 "/a/include/boost/multi_array/extent_range.hpp" 1
# 16 "/a/include/boost/multi_array/extent_range.hpp"
# 1 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/utility" 1 3
# 58 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/utility" 3

# 59 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/utility" 3
# 68 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/utility" 3
# 1 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/x86_64-redhat-linux/bits/c++config.h" 1 3
# 194 "/pool2/ap/gcc/5.1.0/include/c++/5.1.0/x86_64-redhat-linux/bits/c++config.h" 3

Is there any documentation for this format?

Timmmm
  • 88,195
  • 71
  • 364
  • 509
  • 2
    Yes https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output – n. m. could be an AI Sep 05 '18 at 10:13
  • 1
    Possible duplicate of [What is the meaning of lines starting with a hash sign and number like '# 1 "a.c"' in the gcc preprocessor output?](https://stackoverflow.com/questions/5370539/what-is-the-meaning-of-lines-starting-with-a-hash-sign-and-number-like-1-a-c) – rici Sep 08 '18 at 06:47

1 Answers1

2

It's documented in a different section: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html

The flags are used to create a stack of includes to improve error output.

astrange
  • 21
  • 2