Hello!

I think following code will save us:

- Array<Real, 4> arr_surface(&surface.front().real());
+ Array<Real, 4> arr_surface((Real*)&surface.front());

In previous implementation of GCC real() returns reference instead of value.
But anyway old and new standards says what real() should returns value
(not reference). So it's my bug.



> Hello here...
>
> I'm taking care of the "#904 - C++11 and libsigc++ 2.6.0 support"[1] and
> i'm front a problem i need help to solve.
>
> Firstly in this branch, i have enable c++11 support by adding some M4 and
> converting isnan & isinf to std::' [2]
>
> Now i'm front face of "lvalue required as unary '&' operand" errors.
> I take look here and there, try different things, and finally, found a way
> to solve it [3] ... at least it build .
>
> -     Array<Real, 4> arr_surface(&surface.front().real());
> +     Real surfacereal(surface.front().real());
> +     Array<Real, 4> arr_surface(& surfacereal);
>
>
> WHATSTHEPROBBRO?
> ----------------Memory !
> Not leak... but i think that could create memory corruption.
> The surfacereal variable is allocated into the stack and passed by
> references the arr_surface.
>
> What do you think ?
> Does that solution create a potential corruption?
> Do you have a smarter (because i do'nt like it) solution ?
> Does Chinese people also parties on gregorian calendar NY ?
>
> [1] http://www.synfig.org/issues/thebuggenie/synfig/issues/904
> [2]
> https://github.com/d-j-a-y/synfig/commit/6a18f6a87c20889fca3958b15b7914edda24cab8
> [3]
> https://github.com/d-j-a-y/synfig/commit/57e52580ac16155ea3c4dcaeace7886f9cc38c64
> [4]
> https://github.com/d-j-a-y/synfig/blob/master/synfig-core/src/synfig/rendering/software/function/array.h#L160
>
> Nota : if i don't say silly things, the memory corruption was already here
> with previous code implementation.
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Synfig-devl mailing list
> Synfig-devl@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/synfig-devl
>
>



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to