ctdb-tests: Fix CTDB -O3 --picky-developer build on CentOS 7
authorMartin Schwenke <martin@meltin.net>
Thu, 6 Sep 2018 06:06:40 +0000 (16:06 +1000)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Sep 2018 15:26:18 +0000 (17:26 +0200)
gcc 4.8.5 complains:

[319/381] Compiling ctdb/tests/src/system_socket_test.c
../tests/src/system_socket_test.c: In function ‘test_tcp’:
../tests/src/system_socket_test.c:196:20: error: ‘rst_out’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  assert((rst != 0) == (rst_out != 0));
                    ^
cc1: all warnings being treated as errors

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
ctdb/tests/src/system_socket_test.c

index f7d0c7c7701f2300475fe73ebc381b258e97c552..b3959576b5e2dd2850dae204511cd2e821a48231 100644 (file)
@@ -109,7 +109,7 @@ static void test_tcp(const char *src_str,
        ssize_t num_written;
        char src_str_out[64], dst_str_out[64];
        uint32_t seq_out, ack_out;
-       int rst_out;
+       int rst_out = 0;
        uint16_t window;
        int ret;