我将一些用C编写的代码移植到XC,结果这就是我的构建输出。
**** Build of configuration Debug for project camera_with_memory ****
xmake CONFIG=Debug all
Creating dependencies for point.xc
Compiling point.xc
xcc1: internal compiler error
Failed in /build/swnb/autobuild/swview/MacOSX/build/sb/tools_xcc1_c_llvm/BackEnd/LLVM/llvmgen.c, line 9314
isExpVar(d->components->u.dimension)
For bug reporting instructions, please see:
http://www.xmos.com/support
xmake[1]: *** [.build_Debug/src/point.xc.o] Error 1
xmake: *** [bin/Debug/camera_with_memory_Debug.xe] Error 2
是什么原因造成的我真的很困惑我的C代码是大约80行声明如下:
int sort_by_col(int center_points[num_points][2], static const unsigned int num_points,
int col_idx[col_idx_size], static const unsigned int col_idx_size);
最佳答案
这是编译器中的一个错误似乎不能声明其第一个维度是静态常量变量的多维数组,例如。
void f(static const unsigned n) {
unsigned a[n][2];
}
这应该是允许的为了将来参考,由于这个编译器是由XMOS维护的,您可以在这里向它们报告一个bug:
https://www.xmos.com/en/support/contact
这个错误在XMOS编译器的13.0.2版中很明显。
公开:我在编译器上为XMOS工作,因此将报告这个bug。