include/o3tl/safeint.hxx | 1 + include/o3tl/unit_conversion.hxx | 1 + sal/osl/unx/file.cxx | 6 ++++++ tools/source/generic/config.cxx | 1 + 4 files changed, 9 insertions(+)
New commits: commit 0246482b6a6172e6520266c98dde7f0c45b79f28 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Aug 3 21:49:44 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Aug 4 12:37:40 2025 +0200 cid#1659848 silence Logically dead code and cid#1660004 Logically dead code cid#1659644 Logically dead code cid#1659901 Logically dead code cid#1660015 Logically dead code Change-Id: I260149b3f46c86cc7e7c4198242cd3f19cb30f05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188900 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> 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 <typename T> inline constexpr T saturating_add(T a, T b) return std::numeric_limits<T>::max(); } } else { + // coverity[dead_error_line] - suppress warning for template if (a >= std::numeric_limits<T>::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 <typename F, std::enable_if_t<std::is_floating_point_v<F>, 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<sal_uInt8[]> 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; }
