**** 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:
xmake[1]: *** [.build_Debug/src/point.xc.o] Error 1
xmake: *** [bin/Debug/camera_with_memory_Debug.xe] Error 2
这个错误出现在当我加入一个移植自我写的程序的一个函数在C的时候。如果我添加功能注释它就消失了。这是函数定义:
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);
实际函数是~80行代码和相当简单的。它需要一个点(x,y)值和填充柱坐标进行索引值,每个点似乎在col_idx阵列(列被定义为在一个y值的范围存在的点)
回答:
我发现一个方法来消除这个错误。如果我们不允许创建“动态”的二维数组,它应该是定期的错误。这个可能是个BUG。
在我的函数里我有这行代码:
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
我除去错误。