我将用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);发布于 2014-03-18 08:28:36
这是编译器中的一个bug。它似乎不能声明一个多维数组,其第一个维度是一个静态的const变量。
void f(static const unsigned n) {
unsigned a[n][2];
}这是应该允许的。作为将来的参考,由于这个编译器是由XMOS维护的,所以您可以在这里向他们报告一个bug:
https://www.xmos.com/en/support/contact
这个错误在XMOS编译器的13.0.2版本中很明显。
公开:我在编译器上为XMOS工作,所以我会报告这个错误。
发布于 2014-03-17 22:07:52
我找到了消除这个错误的方法。不过,我觉得这是个错误。
在我的函数中,我有以下代码:
int working_array[size_points][2]; // array for copying data points将其替换为以下两行:(并调整其余代码以处理两个数组而不是一个数组)
int working_array_x[size_points]; // array for copying data points
int working_array_y[size_points]; // array for copying data points我消除了错误。
https://stackoverflow.com/questions/22463833
复制相似问题