summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-26 12:22:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-07-27 09:32:19 +0200
commitba1e1727c238210b022741a710486964f28bb065 (patch)
tree8b8a5afbc4a16eef7dc95b144937fa57cf6c9abd /sal
parent877dd9e9d1c1774817fa96f62adda98d5bce0ce8 (diff)
Related: rhbz#1602589 add comments to coverity annotations
Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7 Reviewed-on: https://gerrit.libreoffice.org/58093 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file.cxx4
-rw-r--r--sal/osl/unx/pipe.cxx9
-rw-r--r--sal/osl/w32/file.cxx4
-rw-r--r--sal/rtl/alloc_arena.cxx2
-rw-r--r--sal/rtl/alloc_cache.cxx6
5 files changed, 13 insertions, 12 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 0101bf6f8e36..94aa6e42fc8a 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1134,10 +1134,10 @@ const off_t MAX_OFF_T = std::numeric_limits< off_t >::max();
namespace {
-//coverity[result_independent_of_operands]
+// coverity[result_independent_of_operands] - crossplatform requirement
template<typename T> bool exceedsMaxOffT(T n) { return n > MAX_OFF_T; }
-//coverity[result_independent_of_operands]
+// coverity[result_independent_of_operands] - crossplatform requirement
template<typename T> bool exceedsMinOffT(T n)
{ return n < std::numeric_limits<off_t>::min(); }
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 0c68255dbb1d..eb03ff2280c5 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -287,10 +287,11 @@ oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options,
if (listen(pPipe->m_Socket, 5) < 0)
{
SAL_WARN("sal.osl.pipe", "listen() failed: " << strerror(errno));
- // coverity[toctou] cid#1255391 warns about unlink(name) after
- // stat(name, &status) above, but the intervening call to bind makes
- // those two clearly unrelated, as it would fail if name existed at
- // that point in time:
+ // cid#1255391 warns about unlink(name) after stat(name, &status)
+ // above, but the intervening call to bind makes those two clearly
+ // unrelated, as it would fail if name existed at that point in
+ // time:
+ // coverity[toctou] - this is bogus
unlink(name); /* remove filesystem entry */
close(pPipe->m_Socket);
destroyPipeImpl(pPipe);
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index aed1b315bb9e..a63b58a1bdca 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -776,7 +776,7 @@ oslFileError SAL_CALL osl_closeFile(oslFileHandle Handle)
namespace {
-//coverity[result_independent_of_operands]
+// coverity[result_independent_of_operands] - crossplatform requirement
template<typename T> bool exceedsMaxSIZE_T(T n)
{ return n > std::numeric_limits< SIZE_T >::max(); }
@@ -930,7 +930,7 @@ LONGLONG const g_limit_longlong = std::numeric_limits< LONGLONG >::max();
namespace {
-//coverity[result_independent_of_operands]
+// coverity[result_independent_of_operands] - crossplatform requirement
template<typename T> bool exceedsMaxLONGLONG(T n)
{ return n > g_limit_longlong; }
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 1cd06615d1a3..39e694e017d8 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -258,7 +258,7 @@ void rtl_arena_hash_rescale(
rtl_arena_segment_type * next = curr->m_fnext;
rtl_arena_segment_type ** head;
- // coverity[negative_shift]
+ // coverity[negative_shift] - bogus
head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]);
curr->m_fnext = (*head);
(*head) = curr;
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index 38449ccfb795..41886c7ac235 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -817,7 +817,7 @@ void rtl_cache_deactivate(rtl_cache_type * cache)
/* cleanup cpu layer */
if ((mag = cache->m_cpu_curr))
{
- // coverity[missing_lock]
+ // coverity[missing_lock] - locking is fine
cache->m_cpu_curr = nullptr;
rtl_cache_magazine_clear (cache, mag);
rtl_cache_free (mag_cache, mag);
@@ -825,7 +825,7 @@ void rtl_cache_deactivate(rtl_cache_type * cache)
if ((mag = cache->m_cpu_prev))
{
- // coverity[missing_lock]
+ // coverity[missing_lock] - locking is fine
cache->m_cpu_prev = nullptr;
rtl_cache_magazine_clear (cache, mag);
rtl_cache_free (mag_cache, mag);
@@ -1267,7 +1267,7 @@ static void rtl_cache_depot_wsupdate(
RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
}
}
- // coverity[missing_unlock]
+ // coverity[missing_unlock] - locking is fine
}
/**