From: Jérémie Galarneau Date: Sat, 6 May 2017 19:04:27 +0000 (-0400) Subject: Silence bogus Coverity warning of uninitialized value X-Git-Tag: v2.11.0-rc1~605 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1065191b50b33888c6cf5f359c73bd97ee21f0bb;p=lttng-tools.git Silence bogus Coverity warning of uninitialized value Coverity complains that struct lttng_trigger_comm's payload field is not initialized. "payload" is a flexible array member which should be ignored. Normally, a such a member _could_ result in additional padding added at the end of the structure. In this case, the structure is declared as packed. Nonetheless, using a designated initializer gets rid of the ambiguity and silences Coverity. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/trigger.c b/src/common/trigger.c index 13f26d661..ab2404ca5 100644 --- a/src/common/trigger.c +++ b/src/common/trigger.c @@ -148,7 +148,7 @@ error: LTTNG_HIDDEN ssize_t lttng_trigger_serialize(struct lttng_trigger *trigger, char *buf) { - struct lttng_trigger_comm trigger_comm; + struct lttng_trigger_comm trigger_comm = { 0 }; ssize_t action_size, condition_size, offset = 0, ret; if (!trigger) {