From d4298c99f2fc4864cdabb3a90fed4d1117308a51 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 22 Apr 2013 15:04:37 -0400 Subject: [PATCH] Fix: set ptr to NULL to suppress old gcc warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This has been seen with gcc 4.4.5 on a 32 bit machine. consumer.c: In function ‘consumer_add_relayd_socket’: consumer.c:3002: warning: ‘relayd’ may be used uninitialized in this function However, the relayd pointer can not be used uninitialized so this patch suppresses the warning. Reported-by: Mathieu Desnoyers Signed-off-by: David Goulet --- src/common/consumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index 52a4ed171..cc6c97868 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -2999,7 +2999,7 @@ int consumer_add_relayd_socket(int net_seq_idx, int sock_type, { int fd = -1, ret = -1, relayd_created = 0; enum lttng_error_code ret_code = LTTNG_OK; - struct consumer_relayd_sock_pair *relayd; + struct consumer_relayd_sock_pair *relayd = NULL; assert(ctx); assert(relayd_sock); -- 2.34.1