From 925a3a281e9fe4bc6d1f62d8c1ade83e46bf87f9 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 29 Oct 2009 15:48:48 +0100 Subject: sb116: #i106384# avoid GCC warnings produced if -fno-strict-aliasing were removed (patch by cmc) --- sal/rtl/source/math.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sal/rtl/source/math.cxx') diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index a255ca21b13a..012046c9e5c8 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -879,8 +879,13 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, rtl::math::setNan( &fVal ); if (bSign) { - reinterpret_cast< sal_math_Double * >(&fVal)->w32_parts.msw - |= 0x80000000; // create negative NaN + union { + double sd; + sal_math_Double md; + } m; + m.sd = fVal; + m.md.w32_parts.msw |= 0x80000000; // create negative NaN + fVal = m.sd; bSign = false; // don't negate again } // Eat any further digits: -- cgit