Timmmm
Timmmm

Reputation: 96655

Format of GCC-style line directives

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?

Upvotes: 3

Views: 804

Answers (1)

astrange
astrange

Reputation: 21

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.

Upvotes: 2

Related Questions