From: Jérémie Galarneau Date: Sat, 6 May 2017 18:59:48 +0000 (-0400) Subject: Silence bogus Coverity warning of uninitialized value X-Git-Tag: v2.11.0-rc1~606 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1e9e2705e215f6241ea04e0c94eed6616e2a6434;p=lttng-tools.git Silence bogus Coverity warning of uninitialized value Coverity complains that struct lttng_notification_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/notification.c b/src/common/notification.c index 5062ca5b1..785af6816 100644 --- a/src/common/notification.c +++ b/src/common/notification.c @@ -50,7 +50,7 @@ ssize_t lttng_notification_serialize(struct lttng_notification *notification, char *buf) { ssize_t ret, condition_size, evaluation_size, offset = 0; - struct lttng_notification_comm notification_comm; + struct lttng_notification_comm notification_comm = { 0 }; if (!notification) { ret = -1;