From: Jérémie Galarneau Date: Thu, 12 Sep 2019 13:50:29 +0000 (-0400) Subject: Clean-up: suppress bogus scan-build warning X-Git-Tag: v2.12.0-rc1~397 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=1f2292f6d16cea53dc94c0e16ab08eb71b70b938;hp=8ac478d0ad55edd322b2a4c6931e452d809bf5f3 Clean-up: suppress bogus scan-build warning scan-build seems confused about the address passed to free() and reports that chunk elements are passed with an offset of 8 bytes from the address that was returned by calloc(). Move the inner-trace chunk of an element to the start of the element wrapper-structure to silence this warning. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/trace-chunk.c b/src/common/trace-chunk.c index f7a4372b4..908bdf9fe 100644 --- a/src/common/trace-chunk.c +++ b/src/common/trace-chunk.c @@ -91,8 +91,8 @@ struct lttng_trace_chunk { /* A trace chunk is uniquely identified by its (session id, chunk id) tuple. */ struct lttng_trace_chunk_registry_element { - uint64_t session_id; struct lttng_trace_chunk chunk; + uint64_t session_id; /* Weak and only set when added. */ struct lttng_trace_chunk_registry *registry; struct cds_lfht_node trace_chunk_registry_ht_node;