From: "cron2 (Code Review)" Date: Wed, 12 Nov 2025 10:00:06 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <76ee724976f99be49fcf8c05bf85c19cda000cbd-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="gDkdYslO898="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: msvc: fix struct initialization for v19 compilers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: flichtenheld , plaisthos , openvpn-devel --gDkdYslO898= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 66?usp=3Demail ) Change subject: msvc: fix struct initialization for v19 compilers ...................................................................... msvc: fix struct initialization for v19 compilers 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 Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366 Message-Id: <20251111172504.7683-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 327.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_verify_mbedtls.c M tests/unit_tests/openvpn/test_crypto.c M tests/unit_tests/openvpn/test_pkcs11.c 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpn/ssl_verify_mbedtls.c b/src/openvpn/ssl_verify_mbed= tls.c index 9e2aa19..80ef837 100644 --- a/src/openvpn/ssl_verify_mbedtls.c +++ b/src/openvpn/ssl_verify_mbedtls.c @@ -230,7 +230,7 @@ * headers and footer */ struct buffer pem =3D alloc_buf_gc(cert->raw.len * 3 + 100, &gc); - struct buffer der =3D {}; + struct buffer der =3D { 0 }; buf_set_read(&der, cert->raw.p, cert->raw.len); if (!crypto_pem_encode("CERTIFICATE", &pem, &der, &gc)) diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/open= vpn/test_crypto.c index 93dfa42..ba386bd 100644 --- a/tests/unit_tests/openvpn/test_crypto.c +++ b/tests/unit_tests/openvpn/test_crypto.c @@ -535,7 +535,7 @@ 0x1d, 0x6f, 0x64, 0x8b, 0xdf, 0x96, 0x59, 0x67, 0x= 76, 0xaf, 0xdb, 0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0x= cb, 0x04 }; - uint8_t info[] =3D {}; + uint8_t info[] =3D { 0 }; int L =3D 42; uint8_t okm[42] =3D { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, = 0x71, 0x5f, 0x80, diff --git a/tests/unit_tests/openvpn/test_pkcs11.c b/tests/unit_tests/open= vpn/test_pkcs11.c index 81d2280..44bfa1d 100644 --- a/tests/unit_tests/openvpn/test_pkcs11.c +++ b/tests/unit_tests/openvpn/test_pkcs11.c @@ -411,7 +411,7 @@ test_tls_ctx_use_pkcs11(void **state) { (void)state; - struct tls_root_ctx tls_ctx =3D {}; + struct tls_root_ctx tls_ctx =3D { 0 }; uint8_t sha1[HASHSIZE]; for (struct test_cert *c =3D certs; c->cert; c++) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1366?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2 Gerrit-Change-Number: 1366 Gerrit-PatchSet: 2 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --gDkdYslO898= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

msvc: fix struct initialization for v19 compiler=
s

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: '}= 9;

with version 19.38.33133 installed on a test system.

Chang= e-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Signed-off-by: Heiko Hun= d <heiko@...2662...>
Acked-by: Frank Lichtenheld <frank@...2746...= ...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
Messa= ge-Id: <20251111172504.7683-1-gert@...1296...>
URL: https://www.ma= il-archive.com/openvpn-devel@lists.sourceforge.net/msg34327.html
Signed-= off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/ssl_ve= rify_mbedtls.c
M tests/unit_tests/openvpn/test_crypto.c
M tests/unit_= tests/openvpn/test_pkcs11.c
3 files changed, 3 insertions(+), 3 deletion= s(-)

diff --git a/src/openvpn/ssl_verify_mbedtls.c b/src/openvpn/ssl_verify_m=
bedtls.c
index 9e2aa19..80ef837 100644
--- = a/src/openvpn/ssl_verify_mbedtls.c
+++ b/src/openvpn/ssl_ve= rify_mbedtls.c
@@ -230,7 +230,7 @@
* = headers and footer */
struct buffer pem =3D alloc_buf_= gc(cert->raw.len * 3 + 100, &gc);

- struct buffer der =3D {};+ struct buffer der =3D { = 0 };
buf_set_read(&der, cert->raw.p, cert->r= aw.len);

if (!crypto_pem_encode(&quo= t;CERTIFICATE", &pem, &der, &gc))
diff --g= it a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/openvpn/test= _crypto.c
index 93dfa42..ba386bd 100644
---= a/tests/unit_tests/openvpn/test_crypto.c
+++ b/tests/unit_= tests/openvpn/test_crypto.c
@@ -535,7 +535,7 @@
<= span> 0x1d, 0x6f, 0x64, 0x8b, 0xdf, 0x96, 0x59, 0x6= 7, 0x76, 0xaf, 0xdb,
0x63, 0x77, 0= xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 };
- uint8_t info[] =3D {};

+ uint8_t info[] =3D = { 0 };

int L =3D 42;
uint8_t okm[42] =3D { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f,= 0x71, 0x5f, 0x80,
diff --git a/tests/unit_tests/openvpn/te= st_pkcs11.c b/tests/unit_tests/openvpn/test_pkcs11.c
index = 81d2280..44bfa1d 100644
--- a/tests/unit_tests/openvpn/test= _pkcs11.c
+++ b/tests/unit_tests/openvpn/test_pkcs11.c
@@ -411,7 +411,7 @@
test_tls_ctx_use_pkcs11(vo= id **state)
{
(void)state;
= - struct tls_root_ctx tls_ctx = =3D {};
+ struct t= ls_root_ctx tls_ctx =3D { 0 };
uint8_t sha1[HASHSIZE];=
for (struct test_cert *c =3D certs; c->cert; c++)<= /span>
{

To view, visit <= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1366?usp=3Demail">change 13= 66. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I13e34119303e056fdb51ff9925f= 4944171c824f2
Gerrit-Change-Number: 1366
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --gDkdYslO898=--