A static const variable is implicitly zero initialized
authorTomas Mraz <tomas@openssl.org>
Tue, 27 Sep 2022 15:39:01 +0000 (17:39 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 27 Sep 2022 15:39:01 +0000 (17:39 +0200)
Older clang versions complain about the explicit initializer
because the first member of the struct is a struct.
But it is not necessary to explicitly initialize it anyway.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19284)

crypto/bio/bss_dgram_pair.c

index f2d6ecbb56fbec6e05ca5950dafd52deb92b8c90..2b99f794e0664f438d92e400def3483a28fa3f2d 100644 (file)
@@ -1012,7 +1012,7 @@ static ossl_ssize_t dgram_pair_write_actual(BIO *bio, const char *buf, size_t sz
                                             const BIO_ADDR *local, const BIO_ADDR *peer,
                                             int is_multi)
 {
-    static const BIO_ADDR zero_addr = {0};
+    static const BIO_ADDR zero_addr;
     size_t saved_idx, saved_count;
     struct bio_dgram_pair_st *b = bio->ptr, *peerb;
     struct dgram_hdr hdr = {0};