diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index e5ac7d6821d7..8b7eca4b34dd 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -362,7 +362,8 @@ public: @since LibreOffice 3.5 */ sal_Char operator [](sal_Int32 index) const { - assert(index >= 0 && index < getLength()); + // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2 + assert(index >= 0 && static_cast(index) < static_cast(getLength())); return getStr()[index]; } diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 327f455f1648..79ddfb0ca788 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -417,7 +417,8 @@ public: @since LibreOffice 3.5 */ sal_Unicode operator [](sal_Int32 index) const { - assert(index >= 0 && index < getLength()); + // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2 + assert(index >= 0 && static_cast(index) < static_cast(getLength())); return getStr()[index]; }