]> git.feebdaed.xyz Git - 0xmirror/openvpn.git/commitdiff
msvc: fix struct initialization for v19 compilers
authorHeiko Hund <heiko@ist.eigentlich.net>
Tue, 11 Nov 2025 17:24:57 +0000 (18:24 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 12 Nov 2025 09:54:36 +0000 (10:54 +0100)
Newer version of MSVC do not show the error anymore, but I do get, e.g.:

  test_crypto.c(538,23): error C2059: syntax error: '}'

with version 19.38.33133 installed on a test system.

Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
Message-Id: <20251111172504.7683-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34327.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl_verify_mbedtls.c
tests/unit_tests/openvpn/test_crypto.c
tests/unit_tests/openvpn/test_pkcs11.c

index 9e2aa19fec550d54281df7272e23e3ffbe10c991..80ef8373401dc6a60fa7cf919d72ffec0e52551c 100644 (file)
@@ -230,7 +230,7 @@ backend_x509_write_pem(openvpn_x509_cert_t *cert, const char *filename)
      * headers and footer */
     struct buffer pem = alloc_buf_gc(cert->raw.len * 3 + 100, &gc);
 
-    struct buffer der = {};
+    struct buffer der = { 0 };
     buf_set_read(&der, cert->raw.p, cert->raw.len);
 
     if (!crypto_pem_encode("CERTIFICATE", &pem, &der, &gc))
index 93dfa423661b7fc44faad92b7193587863cb2e01..ba386bd0f55a6775830a276a1894fe07b11511a9 100644 (file)
@@ -535,7 +535,7 @@ crypto_test_hkdf_expand_testa3(void **state)
                         0x1d, 0x6f, 0x64, 0x8b, 0xdf, 0x96, 0x59, 0x67, 0x76, 0xaf, 0xdb,
                         0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 };
 
-    uint8_t info[] = {};
+    uint8_t info[] = { 0 };
 
     int L = 42;
     uint8_t okm[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f, 0x80,
index 81d2280a86fc4969e945a191d2b9a7ad0146e1d6..44bfa1dedbc5d24c5dcb7364b44c647e2dfff5e5 100644 (file)
@@ -411,7 +411,7 @@ static void
 test_tls_ctx_use_pkcs11(void **state)
 {
     (void)state;
-    struct tls_root_ctx tls_ctx = {};
+    struct tls_root_ctx tls_ctx = { 0 };
     uint8_t sha1[HASHSIZE];
     for (struct test_cert *c = certs; c->cert; c++)
     {