【发布时间】:2019-09-21 10:48:00
【问题描述】:
我用 intel icc 编译器编译了一些简单的代码,我注意到每行末尾都有一些数字。我想知道是什么意思。
就像下面代码中的#3.12。
#include <stdio.h>
int main() {
int a = 3, b;
scanf("%d", &b);
a = a + b;
printf("Hello, world! I am %d\n", a);
return 0;
}
...
main:
..B1.1: # Preds ..B1.0
# Execution count [1.00e+00]
..L1:
#3.12
pushl %ebp #3.12
movl %esp, %ebp #3.12
andl $-128, %esp #3.12
...
【问题讨论】:
-
对应C代码的行列号? ICC 手册中提到了一些称为“#line 指令,编译器使用它来确定源文件和行号”。但据我所知,它没有指定这些指令的格式。
-
@Michael 你是对的,也是错的。数字是对应代码的行列,但和
#linedirective没有直接关系,__LINE__和__FILE__编译时用来手动设置内部宏的值(间接关系在使用#line指令设置行号的方式将影响程序集输出中显示的行号)。