summaryrefslogtreecommitdiff
path: root/sal/osl
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/osl
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/osl')
-rw-r--r--sal/osl/unx/file.cxx4
-rw-r--r--sal/osl/unx/pipe.cxx9
-rw-r--r--sal/osl/w32/file.cxx4
3 files changed, 9 insertions, 8 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; }