diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2011-11-10 11:16:56 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-11 09:16:21 +0100 |
commit | e82b120410820e978b87b0a0f3b99718f3671fb1 (patch) | |
tree | 535869d543ded89ac08c653305f6bb3ffb717eb3 /qmake | |
parent | 64c8691548d357d34521ec698050cf4d442eee3d (diff) |
avoid type aliasing
For -O2 gcc activates -fstrict-aliasing. As a result the compiler is
allowed to assume that pt[1]=px[1]/3+B1 does not affect t.
Therefore the result of _fast_cbrt() was always 0.
Using a union for casting avoids this issue.
For more details see:
http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing
Also the updated code respect endianness.
Change-Id: Id4bed16efac52e494e7357dc2f23f94e8c525df1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'qmake')
0 files changed, 0 insertions, 0 deletions