G ++ -E output

Using this option, I get files after preprocessing. There are many lines, for example:

# 91 "/usr/include/stdint.h" 3 4 

What do the numbers mean? At first I thought that #91 is the line number the file is included in, but it is not. And about 3 4 I have no idea.

+5
source share
3 answers

According to the official documentation , the line has the format:

 # linenum filename flags 

linenum indicates that the next line occurred in filename with this line number. Then there are four flags:

  • 1 - start a new file
  • 2 - Return to file
  • 3 - system header file
  • 4 - handle as wrapped in extern "C"

So, let's interpret your linemarker:

 # 91 "/usr/include/stdint.h" 3 4 

The next line is taken from line 91 /usr/include/stdint.h . This is a system header file and should be considered wrapped in extern "C" .

+8
source

They are called "linear markers." From the documentation :

The name of the source file and information about the line number are transmitted by the form lines

 # linenum filename flags 

They are called linear markers. They are inserted as needed into the output file (but never in a string or character constant). They mean that the next line occurred in the filename in the linenum line. filename will never contain any non-printable characters; they are replaced with octal escape sequences.

After the file name, zero or more flags '1' , '2' , '3' or '4' appear. If there are several flags, spaces separate them. Here is what the following flags mean:

  • '1' - This indicates the beginning of a new file.
  • '2' - This indicates the return of the file (after including another file).
  • '3' - This means that the following text comes from the system header file, so some warnings should be suppressed.
  • '4' - This means that the following text should be considered wrapped in an implicit extern "C" block.
+5
source

There are flags (space separated), but the meaning is:

 1 - Start of a new file 2 - Returning to previous file 3 - Following text comes from a system header file (#include <> vs #include "") 4 - Following text should be treated as being wrapped in an implicit extern "C" block. 
+1
source

Source: https://habr.com/ru/post/948944/


All Articles