To fix this error with GCC>4.5:
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I../libpixy -I. -I. -o clut.o clut.cpp
clut.cpp: In function ‘double** plotcluster(uint32_t_, int)’:
clut.cpp:82:98: error: taking address of temporary array
clut.cpp:87:103: error: taking address of temporary array
clut.cpp:98:55: error: taking address of temporary array
clut.cpp: In function ‘double iterateline(double_, double_, int, double_, double, double)’:
clut.cpp:192:81: error: taking address of temporary array
Please apply this patch:
--- clut.cpp.orig 2013-11-19 13:51:02.492603070 +0100
+++ clut.cpp 2013-11-19 14:40:15.991826934 +0100
@@ -79,12 +79,13 @@
double lp[] = {ps, slope*meanx-ps*meanx};
// Find upper and lower major lines
- double yu = iterateline(ppp1, ppp2, d_len/3, (double []){slope, 0}, fabs(0.001/cos(angle)), e);
+ double li[] = {slope, 0};
+ double yu = iterateline(ppp1, ppp2, d_len/3, li, fabs(0.001/cos(angle)), e);
yu = yu + fabs(d * yu);
double lu[] = {slope, yu};
- double yd = iterateline(ppp1, ppp2, d_len/3, (double []){slope, 0}, -1.0*fabs(0.001/cos(angle)), e);
+ double yd = iterateline(ppp1, ppp2, d_len/3, li, -1.0*fabs(0.001/cos(angle)), e);
yd = yd - fabs(d*yd);
double ld[] = {slope, yd};
@@ -95,7 +96,9 @@
yl = yl + -1*sign(uv[1])*fabs(d2*(yl-lp[1]));
double xxl = yl / (slope-ps);
double yyl = xxl * slope;
- double sat = dot_1dim(uv, (double []){xxl, yyl}, 2);
+
+ double arr2[] = {xxl, yyl};
+ double sat = dot_1dim(uv, arr2, 2);
if (sat < minsat)
{
double minl[] = {uv[0]*minsat, uv[1]*minsat};
@@ -189,7 +192,8 @@
while (1)
{
- double btest = boundtest(P0, P1, P_len, (double []) {LI[0], ret}, d_sign);
+ double li2[] = {LI[0], ret};
+ double btest = boundtest(P0, P1, P_len, li2, d_sign);
double temp = (btest/double(P_len));
if (temp >= e)