Fix: set ptr to NULL to suppress old gcc warnings
authorDavid Goulet <dgoulet@efficios.com>
Mon, 22 Apr 2013 19:04:37 +0000 (15:04 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 22 Apr 2013 19:04:37 +0000 (15:04 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c

index 52a4ed171d6b0dde5d1759c781f54ef45994cab0..cc6c978686ffaf18697c7a54a84ff581f7bf579b 100644 (file)
@@ -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);
This page took 0.028062 seconds and 4 git commands to generate.