From 3c598c4064cffdc2c9ff19e094594ca360779b66 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 8 May 2012 10:58:02 +0200 Subject: sal: work around spurious signed overflow warnings gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC): /rtl/string.hxx:1037:67: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow] --- sal/inc/rtl/string.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 0d90b53239d3..4e76b7410303 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -1033,8 +1033,9 @@ public: */ OString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(()) { - assert(beginIndex >= 0 && beginIndex <= getLength() - && count >= 0 && count <= getLength() - beginIndex); + assert(beginIndex >= 0 && beginIndex <= getLength() && count >= 0 + && sal::static_int_cast(count) <= + sal::static_int_cast(getLength() - beginIndex)); if ( (beginIndex == 0) && (count == getLength()) ) return *this; else -- cgit