diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-09-07 08:41:05 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-09-09 08:56:41 +1000 |
commit | 18274e1d6e10081fb7974e40f595e9a1d3224296 (patch) | |
tree | 1f8db778109ea2c3ccc5187c01e9070295104902 /test | |
parent | a4b7136ebfd154636f607c50aaeec778a75b2d26 (diff) | |
download | openssl-18274e1d6e10081fb7974e40f595e9a1d3224296.tar.gz |
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 <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19152)
Diffstat (limited to 'test')
-rw-r--r-- | test/bio_dgram_test.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c index 4fcc49eb67..15731cb647 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; |