【发布时间】:2009-12-05 17:20:48
【问题描述】:
我们最近遇到了以下编译器错误,该错误在整个构建过程中的不同位置重复出现:
line-map.c: file "<a source_file name>" left but not entered
源文件在构建的不同点不同。一段时间后,编译器终于抛出如下错误:
<header file>: In function `<function name that is not present within the given header file>':
<same header file>:-117020: internal compiler error: in final_scan_insn, at final.c:1790
经过大量调查,我们发现这个错误是由不同头文件中的一些#defines引起的:
#define GEOGRAPHIC_LOC_TYPE_CGI 0
#define GEOGRAPHIC_LOC_TYPE_SAI 1
#define GEOGRAPHIC_LOC_TYPE_RAI 2
#define GEOGRAPHIC_LOC_TYPE_TAI 128
#define GEOGRAPHIC_LOC_TYPE_ECGI 129
#define GEOGRAPHIC_LOC_TYPE_TAI_AND_ECGI 130
我们将这些#defines 从它们当前存在的头文件中移动到 .c 文件中,这是当前使用它们的唯一位置。然后,我们再也看不到编译器错误了。
谁能解释上述编译器错误的含义以及此修复为何有效?
谢谢, 瑞恩
【问题讨论】:
标签: c gcc compiler-errors