On Wed, Dec 21, 2016 at 3:02 PM, Derek Foreman <der...@osg.samsung.com> wrote:
> On 21/12/16 10:45 AM, marcel-hollerb...@t-online.de wrote:
>> On Wed, Dec 21, 2016 at 05:33:20PM +0100, Stefan Schmidt wrote:

[snip]

> Are you asking for an explanation of why floating point comparison with
> == in C is bad?  This is axiomatic and hardly needs discussion in this
> forum.

It might be idiomatic, but is not necessarily The Correct Thing(tm).
The assignment case being one example, another one being actually
knowing the correct delta to compare to.

> I haven't seen that suggested by anyone, probably because it's a bad idea.
>
>> Little side note: Claiming that you have to know a codebase for changing
>> a==b to EINA_DBL_CMP(a,b) is NOT realistic :)
>
> ENOUGH of this!  I've been trying to just sit this one out, but come on!

[snip]

> Further, there may be cases where we intentionally only want a
> comparison to trigger if the value is *exact* (as in, has been set that
> way by assignment).  This could be the case in matrix math operations.

This is the case with C++ test suite, either directly or indirectly by template
instantiations, e.g. when comparing two containers of floats.

> These warnings aren't trivially resolved by people with no familiarity
> with the code.

It does seem to be the case, and the warning itself might actually require
worse code to avoid it. I don't like it.

[snip]

> Floating point comparison in C leads to very difficult to diagnose bugs.
>
> I'm strongly in favor of turning this warning back on immediately.

Then only where it makes sense please. Even then, I don't think
forcing the whole community to deal with this is the right approach.
I'm with Stefan here, first work in a branch, and then when the
number of warnings is actually reasonable, push to master.

> This whole debate makes no sense.
>
> Thanks,
> Derek

Regards,
-- 
Felipe Magno de Almeida

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to