From patchwork Wed Sep 24 12:41:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4447 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c08a:b0:72f:f16c:e055 with SMTP id jr10csp1514928mab; Wed, 24 Sep 2025 05:42:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWXsbElZ33Mru0I7WG2cKQ/s9tE+NEOnZ/COFVvQ5Yhaw83NGs7loquR2WKcoilSPYB9TxNHTdqdg8=@openvpn.net X-Google-Smtp-Source: AGHT+IHpgRk2F1UYoNRfy6r4DhhxTLdirpNUGL5UaUkLvJYwqp85ZqsbCNM4heKkonq67Kpt4+dt X-Received: by 2002:a05:6830:25d6:b0:78d:2d0f:83b4 with SMTP id 46e09a7af769-791464885c2mr3602443a34.11.1758717730533; Wed, 24 Sep 2025 05:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758717730; cv=none; d=google.com; s=arc-20240605; b=Nf+VF97HHKRqzmTyP7hRqp/0PYqrQECal+TU9piLe1gFbAjArpgil+HYm8Ri687Q5z FPCGFrE9h6A4zyyLjV5nLNUur3BMCPo+raiZ9I0Cr8uF5DpwcEcieoblcJFPbD4747WR ejfT5jWMkPZ6urfMlPkQXENyiEkiRNJAvykM530vH2mbw/FKInYux1E4K6i8WT1WOlXV jHw5mLx+7dTKjFdzbNwRlCQ44P70Lc7eF35yzzJCHACICx/UFq+iVngmEtjF8gLfbCdA WWR1Yp4HhH7GZRSZUURrSS5PWPXZMtjkJr1TzL8FTQ2CRu1lWGndG6G1mmu85Asgtcu3 gCeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=//j82+9BJxOsx5j7HOzJ+TwhOwUd8U5yEWKfz23L1M4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=SOX0e2MwDdAF0JhZ+QErIwlh2Rueaq2PxFo6u9djiMKkNeWI6DH/XRz5GHMtZhzwsf Odywb3D9GwAhzEBNfKFB1EbcUJEghOcL4CLNlLmAzmK1dG2Ffon4KEuDZww6u8WqTBX2 nA6p0CUwm1gu5tcKzL/GaUm1V6zvDAy6rloOjdUPVQZWntoXjx9T/CpeaNml6QDXYbS1 Rh2gPWZUD0gUZzrBYJrH+SzpmCfQGmadYWeARzhVQdusS3US7f5rrxXMjhq3bWp5rxcP tRNHLAGGvcoywXKw2j9YTKo2UXlvzEhv4hfwxDZQzB4kW8P9BzQQA+eiSrKgQJX1zSl1 CLbw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=bzbgYPNN; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=G8qtesIM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EPiGd+yg; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-78dada5fd50si1635803a34.421.2025.09.24.05.42.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Sep 2025 05:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=bzbgYPNN; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=G8qtesIM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EPiGd+yg; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=//j82+9BJxOsx5j7HOzJ+TwhOwUd8U5yEWKfz23L1M4=; b=bzbgYPNNwK1OOcZAZ6zqSmbvl0 GYBCZ9T+0pwi/ETcdDDnXRb6N5b2lsHpvVGyYxrtSD0+rLiarWv09i8TF9qNDkfhcCGOKeWPqaLBx qpfe0qtShA1WXBAshP7T9+OYPwZgLbQ4JoqVEb1k3c8P4W2BeJjp++j3oEEe1o5piwdw=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v1Ooy-0003e3-E4; Wed, 24 Sep 2025 12:42:08 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v1Oox-0003du-6M for openvpn-devel@lists.sourceforge.net; Wed, 24 Sep 2025 12:42:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nh+Yd6x5Bal2SRXYvkYngQtNATNuBG5hNk0K1CM/VIg=; b=G8qtesIM8hU3Fcm8JmMb0oxKdT azJf0N/6OjgbuWEInqIu9xbwjHWN6gDBEoCEckAkDFLGJFRmDibJDNW8wXGKrCW95gN+JFlS7nNHp Vxi5ANAJZjhWV8nWMWU90fnqVJjErpEeFPLY4sbG3VAxU+mZKNnLNuJNXg0PiRaSFHII=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nh+Yd6x5Bal2SRXYvkYngQtNATNuBG5hNk0K1CM/VIg=; b=EPiGd+yg0ijOINB7njEOD2fiTL vZKDleU6yKlzVG1zKroTvxRR6wKXYb1ou97EYPRu7udIqZL6vLNm37YdZpTCUFlklpvPslefgiXWM HGmha+CtlX4c2zkka39vUtkAEFZs67Te9M4J8lhkRZYFbW+gDuEJ+8KSzNcOWb+C8RFw=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v1Oov-0000TH-Um for openvpn-devel@lists.sourceforge.net; Wed, 24 Sep 2025 12:42:06 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 58OCfsjO015978 for ; Wed, 24 Sep 2025 14:41:54 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58OCfsf2015977 for openvpn-devel@lists.sourceforge.net; Wed, 24 Sep 2025 14:41:54 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 24 Sep 2025 14:41:48 +0200 Message-ID: <20250924124154.15963-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld Only trivial problems left after the other patches have been merged. Change-Id: Iab9e780d9649d7581e5f6aa4b23e72bbed5e145b Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1v1Oov-0000TH-Um Subject: [Openvpn-devel] [PATCH v4] Make unit tests -Wconversion clean X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1844149202820926371?= X-GMAIL-MSGID: =?utf-8?q?1844149202820926371?= From: Frank Lichtenheld Only trivial problems left after the other patches have been merged. Change-Id: Iab9e780d9649d7581e5f6aa4b23e72bbed5e145b Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1205 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1205 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/openvpn/test_crypto.c index 22e6912..93dfa42 100644 --- a/tests/unit_tests/openvpn/test_crypto.c +++ b/tests/unit_tests/openvpn/test_crypto.c @@ -674,15 +674,10 @@ struct crypto_options co; }; -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static int crypto_test_epoch_setup(void **state) { - int *num_future_keys = (int *)*state; + uint16_t *num_future_keys = (uint16_t *)*state; struct epoch_test_state *data = calloc(1, sizeof(struct epoch_test_state)); data->gc = gc_new(); @@ -699,10 +694,6 @@ return 0; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static int crypto_test_epoch_teardown(void **state) { @@ -906,9 +897,9 @@ int main(void) { - int prestate_num13 = 13; - int prestate_num16 = 16; - int prestate_num32 = 32; + uint16_t prestate_num13 = 13; + uint16_t prestate_num16 = 16; + uint16_t prestate_num32 = 32; openvpn_unit_test_setup(); const struct CMUnitTest tests[] = { diff --git a/tests/unit_tests/openvpn/test_ssl.c b/tests/unit_tests/openvpn/test_ssl.c index ed40a7d..8dc9b66 100644 --- a/tests/unit_tests/openvpn/test_ssl.c +++ b/tests/unit_tests/openvpn/test_ssl.c @@ -133,11 +133,6 @@ const char *keyfile; } global_state; -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static int init(void **state) { @@ -152,17 +147,16 @@ { fail_msg("make tmpfile for certificate or key data failed (error = %d)", errno); } - assert_int_equal(write(certfd, unittest_cert, strlen(unittest_cert)), strlen(unittest_cert)); - assert_int_equal(write(keyfd, unittest_key, strlen(unittest_key)), strlen(unittest_key)); + /* Awkward casts required for MinGW with -O0 only */ + assert_int_equal(write(certfd, unittest_cert, (unsigned int)strlen(unittest_cert)), + strlen(unittest_cert)); + assert_int_equal(write(keyfd, unittest_key, (unsigned int)strlen(unittest_key)), + strlen(unittest_key)); close(certfd); close(keyfd); return 0; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static int cleanup(void **state) {