[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#625120: clonalframe: FTBFS: src/move_hidden.cpp:169:62: error: taking address of temporary [-fpermissive]



On 06/29/2011 09:17 AM, Andreas Tille wrote:
> sorry for the late reply to this bug.  I can reproduce the problem on my
> side but I'm not finally sure that this is really a problem of clonalframe
> or whether it is a bad coincidence with libgsl0-dev.  The line in question
> where the problem occures is:
> 
>  src/move_hidden.cpp:423:59: error: taking address of temporary [-fpermissive]                                                                                                                                 
> 
>  423:            Util::normalize(&(gsl_matrix_row(e,i+1).vector));
> 
> So I suspect that there are temporary variables used where they should
> not but these are not declared in Move_hidden::makee().  My c++
> knowledge ist too limited to track down the problem in a reasonable time
> frame and thus I CC debian-mentors and upstream (Xavier please find the
> full log of this bug below or at http://bugs.debian.org/625120).

The attached patch should fix this issue. The problem here is that the return
value of gsl_matrix_row is a non-lvalue and thus one cannot take its address.

Kind regards,
-- 
Sebastian Ramacher
--- clonalframe-1.2.orig/src/move_hidden.cpp
+++ clonalframe-1.2/src/move_hidden.cpp
@@ -166,7 +166,8 @@ namespace wb
                     sum+=gsl_matrix_get(f,j,i)*q[j][state][site-siteprev-1];
                 gsl_matrix_set(f,state,i+1,sum*gsl_matrix_get(e,state,msgs[site]));
             }
-            Util::normalize(&(gsl_matrix_column(f,i+1).vector));
+            gsl_vector_view view = gsl_matrix_column(f,i+1);
+            Util::normalize(&view.vector);
         }
         return f;
     }
@@ -420,7 +421,8 @@ namespace wb
                 gsl_matrix_set(e,i+1,2,(1.0-m2)*m3+(1.0-m3)*m2);
             }
 
-            Util::normalize(&(gsl_matrix_row(e,i+1).vector));
+            gsl_vector_view view = gsl_matrix_row(e,i+1);
+            Util::normalize(&view.vector);
         }
     }
 

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: