summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-08 10:58:02 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-08 11:31:51 +0200
commit3c598c4064cffdc2c9ff19e094594ca360779b66 (patch)
tree9f76d545dd3dad4fdc2b6cd249a772ed5097bad7 /sal
parentaea14bd0718c0eb40c02c0bc989a17096e6fa0be (diff)
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]
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/string.hxx5
1 files 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<sal_uInt32>(count) <=
+ sal::static_int_cast<sal_uInt32>(getLength() - beginIndex));
if ( (beginIndex == 0) && (count == getLength()) )
return *this;
else