gcc -E(二)

From: http://hi.baidu.com/piao123521/item/d8609f430f186dae60d7b958


1 # 1 "1.c"
  2 # 1 "<built-in>"
  3 # 1 "<command-line>"
  4 # 1 "1.c"
  5 # 1 "/usr/local/arm/4.2.2-eabi//usr/include/stdio.h" 1 3 4
  6 # 28 "/usr/local/arm/4.2.2-eabi//usr/include/stdio.h" 3 4
  7 # 1 "/usr/local/arm/4.2.2-eabi//usr/include/features.h" 1 3 4
  8 # 322 "/usr/local/arm/4.2.2-eabi//usr/include/features.h" 3 4
  9 # 1 "/usr/local/arm/4.2.2-eabi//usr/include/sys/cdefs.h" 1 3 4
10 # 324 "/usr/local/arm/4.2.2-eabi//usr/include/sys/cdefs.h" 3 4
11 # 1 "/usr/local/arm/4.2.2-eabi//usr/include/bits/wordsize.h" 1 3 4
12 # 325 "/usr/local/arm/4.2.2-eabi//usr/include/sys/cdefs.h" 2 3 4
13 # 323 "/usr/local/arm/4.2.2-eabi//usr/include/features.h" 2 3 4
14 # 345 "/usr/local/arm/4.2.2-eabi//usr/include/features.h" 3 4
15 # 1 "/usr/local/arm/4.2.2-eabi//usr/include/gnu/stubs.h" 1 3 4
16 # 346 "/usr/local/arm/4.2.2-eabi//usr/include/features.h" 2 3 4
17 # 29 "/usr/local/arm/4.2.2-eabi//usr/include/stdio.h" 2 3 4
18
19
20
21
22
23 # 1 "/usr/local/arm/4.2.2-eabi/usr/bin-ccache/../lib/gcc/arm-unknown-linux-gnueabi/4.2.2/include/stddef.h" 1 3 4
24 # 214 "/usr/local/arm/4.2.2-eabi/usr/bin-ccache/../lib/gcc/arm-unknown-linux-gnueabi/4.2.2/include/stddef.h" 3 4
25 typedef unsigned int size_t;
. . . . . .

# 2 "1.c" 2
917
918 int main(void)
919 {
920  int i = 0;
921  printf("%d\n", i);
922 }

#linenum filename flag
紧接着的内容源于filename文件,并且是filename文件的第linenum行开始的内容。
flag:
1: 开始一个新文件
2:回到文件  
表示一个文件展开完毕,返回展开它的地方。
3:说明以下的内容是来自系统头文件
4:extern "C"

#1 "/usr/local/arm/4.2.2-eabi//usr/include/stdio.h" 1 3 4
下面的内容是stdio.h文件第1行起的内容,以下内容是一个新文件(即stdio.h)的内容,系统头文件,extern C

#2 "1.c" 2
以下内容为1.c的第2行,是回到某一文件(1.c) (从stdio.h回来的~~)

大概可以推断楼主的源文件为
1   #include <stdio.h>
2   
3   int main(void)
....

而用gcc -E 生成的.i文件中,源文件的第2行已变为了917行,中间插入了stdio.h所包含的内容。

---------------
Source file name and line number information is conveyed by lines of the form
# linenum filename flags
These are called linemarkers. They are inserted as needed into the output (but never within
a string or character constant). They mean that the following line originated in file filename
at line linenum. filename will never contain any non-printing characters; they are replaced
with octal escape sequences.
After the file name comes zero or more flags, which are ‘1’, ‘2’, ‘3’, or ‘4’. If there are
multiple flags, spaces separate them. Here is what the flags mean:
‘1’ This indicates the start of a new file.
‘2’ This indicates returning to a file (after having included another file).
‘3’ This indicates that the following text comes from a system header file, so certain
warnings should be suppressed.
‘4’ This indicates that the following text should be treated as being wrapped in an
implicit extern "C" block.
-----------------------------The C Preprocessor For gcc version 4.7.0 (pre-release)-----


你可能感兴趣的:(gcc -E(二))