Address Coverity, Clang static analyzer warnings

* Fix type of num reliable readers (int to int32_t)

* Conversion codes in debug monitor printf formats

* Dead code elimination

* Skipping a test case where SIZE_MAX is assumed > INT32_MAX if
  assumption is false on target platform

* Error handling in os_sockWaitsetNew

* Stick to unsigned in fragment size calculations

  This check is actually guarded by valid_DataFrag and was safe for
  datagrams up to 2GB, but the unintended and implicit conversion to is
  still best eliminated.

* A "server" connection never has an invalid socket in TCP wrapper

* Handle error return from gethostname in SPDP write (CID 248183)

* Handle extended retcodes in dds_strretcode

  CID 248131, introduced by 19aec98b8a

* Remove dead code in ddsrt logging test (CID 248195)

* Validate command-line argument in process test (CID 248117)

* Allow for extremely delayed store in test

  Test is constructed to have the events trigger only at the appropriate
  times, but it does assume that the store to cb_called becomes visible
  prior to the listener callback.  I'm pretty sure that will always be
  the case in practice, but I'm also pretty sure there is no formal
  guarantee without a memory barrier, which mutex_unlock provides.

  CID 248088, 248136, 248177, 253590, 253591, 253593

* Check unsetenv return value in test (CID 248099)

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-09-23 14:52:56 +02:00 committed by eboasson
parent 2996a6b5f8
commit 94483e3371
23 changed files with 121 additions and 96 deletions

View file

@ -355,7 +355,7 @@ MPT_ProcessEntry (rwud,
size_t chkusz = 0;
if (!qget (chk, &chkud, &chkusz))
MPT_ASSERT (0, "Check QoS: no %s present\n", qname);
MPT_ASSERT (chkusz == expusz && (expusz == 0 || memcmp (chkud, expud, expusz) == 0),
MPT_ASSERT (chkusz == expusz && (expusz == 0 || (chkud != NULL && memcmp (chkud, expud, expusz) == 0)),
"Retrieved %s differs from group data just set (%zu/%s vs %zu/%s)\n", qname,
chkusz, chkud ? (char *) chkud : "(null)", expusz, expud ? (char *) expud : "(null)");
dds_free (chkud);