summaryrefslogtreecommitdiffstats
path: root/include/o3tl/safeint.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-25 16:33:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-25 20:39:19 +0100
commitf8965272055bf9e7f3a26ff9f729d88ee856b592 (patch)
treec49386f22bc260d644c777b3128daa5bd08b79f4 /include/o3tl/safeint.hxx
parentcid#1473931 silence Untrusted allocation size (diff)
downloadcore-f8965272055bf9e7f3a26ff9f729d88ee856b592.tar.gz
core-f8965272055bf9e7f3a26ff9f729d88ee856b592.zip
cid#1474353 experiment to silence Untrusted loop bound
Change-Id: I4436427109c92a28890a1bc7f669841c40ec2020 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113101 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/o3tl/safeint.hxx')
-rw-r--r--include/o3tl/safeint.hxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx
index 71239d59c718..c2610edacec6 100644
--- a/include/o3tl/safeint.hxx
+++ b/include/o3tl/safeint.hxx
@@ -239,18 +239,11 @@ make_unsigned(T value)
// tools like -fsanitize=implicit-conversion should still be able to detect truncation:
template<typename T1, typename T2> constexpr T1 narrowing(T2 value) { return value; }
-// std::min wrapped to inform coverity that the result is now sanitized
-#if defined(__COVERITY__)
-extern "C" void __coverity_tainted_data_sanitize__(void *);
-#endif
-
+// std::min wrapped to inform coverity that the result is now deemed sanitized
+// coverity[ -taint_source ]
template<typename T> inline T sanitizing_min(T a, T b)
{
- T ret = std::min(a, b);
-#if defined(__COVERITY__)
- __coverity_tainted_data_sanitize__(&ret);
-#endif
- return ret;
+ return std::min(a, b);
}
}