------- Comment #6 from andrew at warnux dot com  2008-11-28 16:38 -------
I do have a couple concerns:

1. This one is MAJOR.  Without using -Wstrict-aliasing, I never see warnings
about this change.  I can't even begin to explain how bad that is.  The gcc
programmers made a big change (that is default compile) and there isn't even a
warning by default!  I wonder how many other things like this have been done.

2. Will other compilers compile this kind of code correctly?
inline bool IsNegative(float f)
{
    union
    {
        float f;
        int i;
    } u;
    u.f = f;
    return u.i & 0x80000000;
}
http://xania.org/200712/cpp-strict-aliasing


-- 

andrew at warnux dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38297

Reply via email to