From: Tomas Mraz Date: Wed, 7 Sep 2022 06:41:05 +0000 (+0200) Subject: bio_dgram_test.c: Fix warning from older clang compilers X-Git-Tag: openssl-3.2.0-alpha1~2114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18274e1d6e10081fb7974e40f595e9a1d3224296;p=thirdparty%2Fopenssl.git bio_dgram_test.c: Fix warning from older clang compilers Older clang compilers warn about the initializer: test/bio_dgram_test.c:107:29: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct in6_addr ina6 = {0}; ^ {} Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/19152) --- diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c index 4fcc49eb673..15731cb6479 100644 --- a/test/bio_dgram_test.c +++ b/test/bio_dgram_test.c @@ -102,9 +102,9 @@ static int test_bio_dgram_impl(int af, int use_local) int fd1 = -1, fd2 = -1; BIO_ADDR *addr1 = NULL, *addr2 = NULL, *addr3 = NULL, *addr4 = NULL, *addr5 = NULL, *addr6 = NULL; - struct in_addr ina = {0}; + struct in_addr ina; #if defined(OPENSSL_USE_IPV6) - struct in6_addr ina6 = {0}; + struct in6_addr ina6; #endif void *pina; size_t inal, i; @@ -114,9 +114,6 @@ static int test_bio_dgram_impl(int af, int use_local) char tx_buf[128]; size_t num_processed = 0; - ina.s_addr = htonl(0x7f000001UL); - ina6.s6_addr[15] = 1; - if (af == AF_INET) { TEST_info("# Testing with AF_INET, local=%d\n", use_local); pina = &ina; @@ -133,6 +130,10 @@ static int test_bio_dgram_impl(int af, int use_local) goto err; } + memset(pina, 0, inal); + ina.s_addr = htonl(0x7f000001UL); + ina6.s6_addr[15] = 1; + addr1 = BIO_ADDR_new(); if (!TEST_ptr(addr1)) goto err;