From e55dc3703a77d28a067625656cdd593b48afea82 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Mon, 21 Jan 2019 17:36:33 +0100 Subject: [PATCH] address the last remaining warning by Clang's static analyzer Signed-off-by: Erik Boasson --- src/core/ddsi/src/q_radmin.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/ddsi/src/q_radmin.c b/src/core/ddsi/src/q_radmin.c index 73b8cf0..6575a5f 100644 --- a/src/core/ddsi/src/q_radmin.c +++ b/src/core/ddsi/src/q_radmin.c @@ -1945,10 +1945,9 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r reorder->n_samples++; } } - else if (s->min == reorder->max_sampleiv->u.reorder.maxp1) + else if (((void) assert (reorder->max_sampleiv != NULL)), (s->min == reorder->max_sampleiv->u.reorder.maxp1)) { - /* note: sampleivtree not empty <=> max_sampleiv is set (compilers - and static analyzers may warn) */ + /* (sampleivtree not empty) <=> (max_sampleiv is non-NULL), for which there is an assert at the beginning but compilers and static analyzers don't all quite get that ... the somewhat crazy assert shuts up Clang's static analyzer */ if (delivery_queue_full_p) { /* growing last inteval will not be accepted when this flag is set */