From: David Goulet Date: Mon, 22 Apr 2013 19:04:37 +0000 (-0400) Subject: Fix: set ptr to NULL to suppress old gcc warnings X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=d4298c99f2fc4864cdabb3a90fed4d1117308a51 Fix: set ptr to NULL to suppress old gcc warnings 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 --- 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);