ch_init(): Add braces to appease older clang compilers
authorTomas Mraz <tomas@openssl.org>
Wed, 23 Aug 2023 17:57:00 +0000 (19:57 +0200)
committerHugo Landau <hlandau@openssl.org>
Fri, 25 Aug 2023 11:03:54 +0000 (12:03 +0100)
They produce a warning `suggest braces around initialization of subobject`
otherwise.

Add -Wno-missing-braces to silence old clang compilers

And drop unnecessary braces in zeroing initializers.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21823)

Configure
ssl/quic/quic_ackm.c

index 364b699c5750fb4133d1e5b99f8d161c67121d82..cb11a55b7a1fb317b22546f4f96264f0d5b1161a 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -188,6 +188,7 @@ my @clang_devteam_warn = qw(
     -Wno-parentheses-equality
     -Wno-language-extension-token
     -Wno-extended-offsetof
+    -Wno-missing-braces
     -Wconditional-uninitialized
     -Wincompatible-pointer-types-discards-qualifiers
     -Wmissing-variable-declarations
index 7c567eae776b771fefd84572429c117765d12768..aa035da91268e528e02e62e99d6f85b1fb6ab2ad 100644 (file)
@@ -937,7 +937,7 @@ static void ackm_on_pkts_lost(OSSL_ACKM *ackm, int pkt_space,
     const OSSL_ACKM_TX_PKT *p, *pnext;
     OSSL_RTT_INFO rtt;
     QUIC_PN largest_pn_lost = 0;
-    OSSL_CC_LOSS_INFO loss_info = {{0}};
+    OSSL_CC_LOSS_INFO loss_info = {0};
     uint32_t flags = 0;
 
     for (p = lpkt; p != NULL; p = pnext) {
@@ -984,7 +984,7 @@ static void ackm_on_pkts_acked(OSSL_ACKM *ackm, const OSSL_ACKM_TX_PKT *apkt)
 {
     const OSSL_ACKM_TX_PKT *anext;
     QUIC_PN last_pn_acked = 0;
-    OSSL_CC_ACK_INFO ainfo = {{0}};
+    OSSL_CC_ACK_INFO ainfo = {0};
 
     for (; apkt != NULL; apkt = anext) {
         if (apkt->is_inflight) {