diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx index 52b42e28a653..a57f5f269d09 100644 --- a/include/o3tl/safeint.hxx +++ b/include/o3tl/safeint.hxx @@ -36,6 +36,7 @@ template inline constexpr T saturating_add(T a, T b) return std::numeric_limits::max(); } } else { + // coverity[dead_error_line] - suppress warning for template if (a >= std::numeric_limits::min() - b) { return a + b; } else { diff --git a/include/o3tl/unit_conversion.hxx b/include/o3tl/unit_conversion.hxx index 5f78d2ef32c6..4aba0c988613 100644 --- a/include/o3tl/unit_conversion.hxx +++ b/include/o3tl/unit_conversion.hxx @@ -73,6 +73,7 @@ constexpr sal_Int64 MulDiv(I n, sal_Int64 m, sal_Int64 d) { assert(m > 0 && d > 0); assert(isBetween(n, (SAL_MIN_INT64 + d / 2) / m, (SAL_MAX_INT64 - d / 2) / m)); + // coverity[dead_error_line] - suppress warning for template return (n >= 0 ? (n * m + d / 2) : (n * m - d / 2)) / d; } template , int> = 0> diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index a07c08020e36..7678b4813409 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -1428,7 +1428,10 @@ oslFileError SAL_CALL osl_mapFile( *ppAddr = nullptr; if (uLength > SAL_MAX_SIZE) + { + // coverity[dead_error_line] - suppress warning, 32bit platforms still return osl_File_E_OVERFLOW; + } size_t const nLength = sal::static_int_cast< size_t >(uLength); @@ -1504,7 +1507,10 @@ static oslFileError unmapFile(void* pAddr, sal_uInt64 uLength) return osl_File_E_INVAL; if (uLength > SAL_MAX_SIZE) + { + // coverity[dead_error_line] - suppress warning, 32bit platforms still return osl_File_E_OVERFLOW; + } size_t const nLength = sal::static_int_cast< size_t >(uLength); diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx index 9fa470b854ba..07cd81bf1382 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -103,6 +103,7 @@ static std::unique_ptr ImplSysReadConfig( const OUString& rFileName if( aFile.getSize( nPos ) == ::osl::FileBase::E_None ) { if (nPos > SAL_MAX_SIZE) { + // coverity[dead_error_line] - suppress warning, 32bit platforms still aFile.close(); return nullptr; }