On Thu, Mar 10, 2016 at 3:40 PM, Carsten Haitzler <ras...@rasterman.com> wrote:
> On Thu, 10 Mar 2016 17:43:01 +0000 Tom Hacohen <t...@osg.samsung.com> said:
>> On 10/03/16 17:02, Cedric BAIL wrote:
>> > On Mar 10, 2016 8:10 AM, "Tom Hacohen" <t...@osg.samsung.com> wrote:
>> >> Huh? It is valid and the code is correct. What seems to be the problem?
>> >> Works here with no warnings (clang), but anyhow, the code is correct.
>> >
>> >>From gcc point of view gl was undefined when set to sd->genlist and that
>> > did come with a big fat warning :-)
>> >
>>
>> GCC is wrong, but I guess you had to silence it. :|
>
> gcc generates warnings because it sees this as a possible code bug - you pass
> in a reference and fill it then also re-assign the value again as a return 
> from
> the same func. in any sane world most people reading that code would go "wtf?
> is that a bug? did they may to pass in &somethingelse instead of &gl because
> this assigns it twice? are we losing a reference to something here?". gcc is
> saying that. the code itself wasn't broken. it would work, BUT it LOOKS like a
> bug to any "sane person". and gcc warns. the more warnings we let through, the
> more real issues hide in warnings we now ignore in the sea of warnings
> scrolling by. thus why it is being "shut up".
>
> but it is a point - it looks insane. imho eo_add given its current use of &
> should not return anything and we assign return by reference. at least then it
> doesn't look like a bug.

Agreed. It is surely very confusing to have something like obj =
eo_add(&obj, ...
-- 
Cedric BAIL

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to