简体   繁体   中英

Debugging information in GCC preprocessor output

I was inspecting the preprocessed output generated by GCC, and I see a lot of these in the .i file that I generated using the -save-temps flag:

# 8 "/usr/include/i386-linux-gnu/gnu/stubs.h" 2 3 4

What do the numbers before and after the absolute path of stubs.h mean? It seems to be some kind of debugging information that is inserted by the preprocessor and allows the compiler to issue error messages referring to this information. These lines do not affect the program itself, but what specifically is each number for?

Based on the documentation the number before the filename is the line number. The numbers after the file name are a flag and mean the following:

  • 1 indicates the start of a new file.
  • 2 indicates returning to a file (after having included another file).
  • 3 indicates that the following text comes from a system header file, so certain warnings should be suppressed.
  • 4 indicates that the following text should be treated as being wrapped in an implicit extern "C" block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM