include/o3tl/safeint.hxx             |    6 +++++-
 solenv/sanitizers/ubsan-suppressions |    1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 9ed16431e60106359dd3871a6d01e14d61c54b73
Author:     Stephan Bergmann <stephan.bergm...@collabora.com>
AuthorDate: Tue Aug 19 07:50:58 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Tue Aug 19 11:47:51 2025 +0200

    Adapt -fsanitize=float-divide-by-zero suppressions
    
    ...to 23f77eb0e294013716c172a7ea92350253c3d6f3 "cid#1660546 suppress 
Division or
    modulo by float zero".  (While most of the less specific
    solenv/sanitizers/ubsan-suppressions are apparently still needed as per a 
full
    `make check`, the code in scaddins/source/analysis/financial.cxx seem to be
    fully adapted now; that file had been added there with the original
    be9cb972503d1eb6283d43a8bbabfef7f5ffef0a "Silence
    -fsanitize=float-divide-by-zero in some parts of sc", without any details 
what
    issues exactly it suppressed.)
    
    Change-Id: Iafc892d514c1778094bb4ac33317d51effccc8a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189895
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>

diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx
index 94a109fa2799..18a50c86694a 100644
--- a/include/o3tl/safeint.hxx
+++ b/include/o3tl/safeint.hxx
@@ -235,7 +235,11 @@ template<typename T> [[nodiscard]] inline T 
sanitizing_min(T a, T b)
 }
 
 // For use when std::inf is an acceptable result
-[[nodiscard]] inline double div_allow_zero(double a, double b)
+[[nodiscard]]
+#if defined __clang__ || defined __GNUC__
+__attribute__((no_sanitize("float-divide-by-zero")))
+#endif
+inline double div_allow_zero(double a, double b)
 {
 #if defined(__COVERITY__) && __COVERITY_MAJOR__ <= 2024
     assert(b != 0 && "suppress floating point divide_by_zero");
diff --git a/solenv/sanitizers/ubsan-suppressions 
b/solenv/sanitizers/ubsan-suppressions
index 7adaa1e92c00..a47e440f461c 100644
--- a/solenv/sanitizers/ubsan-suppressions
+++ b/solenv/sanitizers/ubsan-suppressions
@@ -18,4 +18,3 @@ float-divide-by-zero:/sc/source/core/tool/interpr2.cxx$
 float-divide-by-zero:/sc/source/core/tool/interpr3.cxx$
 float-divide-by-zero:/sc/source/core/tool/interpr8.cxx$
 float-divide-by-zero:/scaddins/source/analysis/analysis.cxx$
-float-divide-by-zero:/scaddins/source/analysis/financial.cxx$

Reply via email to