From patchwork Wed Oct 8 13:33:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4485 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7d42:b0:72f:f16c:e055 with SMTP id fr2csp940269mab; Wed, 8 Oct 2025 06:33:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJZm87pwUaWhSrRKNgt2SdWU/yXKukEmdtd/miosBrATzW6SRy/e/zOp8Ic9C5fGY5L2Tq4mINc5M=@openvpn.net X-Google-Smtp-Source: AGHT+IGjw6kVsC9Xngc/VY5Fq8yrE7/ZnQFXCQMGcIGscDcuhuwtDmTtc3zXim583Taj3tuge6II X-Received: by 2002:a05:6808:2207:b0:438:3680:d66e with SMTP id 5614622812f47-4417b3dd45cmr1792387b6e.39.1759930434386; Wed, 08 Oct 2025 06:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1759930434; cv=none; d=google.com; s=arc-20240605; b=RSLadQX8rksi9DEdy1ndNcZ40k6EPnvTEX7BE79zo2kcvGIUN0AUpvkNzCfBnz/mFe c1cvq+8yaAHeUc0eWzUS6N73A85PCxXfHiB15yM6ez7O9qOKTB8rJ+El8ghf6+rMmsrd 1Am10ziohhKF894/2xNX9/R+00QJ23Fej0RY3AST00iInqvgOeNuXPlOlVGJL96A25GX MED/HjPvyt6cJ1qNM3GUCeZNAV6tf3fkolegoikeXCQSMnPQ6Sin/NpbEUUBKTk2u4kv bi3TEhzdB8KmQtLES9eAupmhPx1J4HcGkDA2YhvpL1kpGQFJIG04VNJ9s+i8nV+vpzG8 8OFw== 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=/CTOXv6deg1EdWlJ7FvNfYOFj2qZkMWZIaJGUBU/hJI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=dM9SjSKpGF5+tubDUgQ4lwaWW7DyFmaWSOHDkSEi+4rxCG2XiWNFiDCTVQtTAMl71O S92n4Euobts00/wGBhQc8I8+6TYG+GqKspQOR0u1AagiKJ+rWuEKbBIkWBOVfcQuKIU4 0H9wOu57YI6DmhdVoCR31rs3LE//MtB5h9jG7OQ84tjrw/R+z7Blv2YR7fYb+X/oRySt E7zPnILsCuQ+ao1VStuB6h0Lx/GfQIz3dWvIIwJll5OF+CTiyldg4yhRi9SENJVSFlfj lYQZCEuDS+jy5ePKPmyu1DDyUKxTqVDIEWoxn3+n86N6ZBpcFavslwQZSBvzsBNRKbgH QHbg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="DQ/lMCHs"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=YGVl3Ioq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="I/NgY6NG"; 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-7c06bf6068asi1300145a34.487.2025.10.08.06.33.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Oct 2025 06:33:54 -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="DQ/lMCHs"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=YGVl3Ioq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="I/NgY6NG"; 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=/CTOXv6deg1EdWlJ7FvNfYOFj2qZkMWZIaJGUBU/hJI=; b=DQ/lMCHsFrnJZvrWrulqSRsfPp FxhT2aQk7WYcRI1xxAjExXKm8M/hClNJ0wvdWHGfp7zN7+ei4yX/A2ZbBNrVPQvoxt1ZSduJ4x+Zk 8JeEzea0HplMJ0bjDhvbgPSPFPRqCyLcWqgsNXjakLGL2w9bWuUPyh+iDvhL69c8aOmo=; 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 1v6UIh-00066L-Mb; Wed, 08 Oct 2025 13:33:51 +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 1v6UIh-00066E-3b for openvpn-devel@lists.sourceforge.net; Wed, 08 Oct 2025 13:33:51 +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=F9W1MzbwXxTnMI/g40XpiaYywfX3Yy1GmaLna7FLNes=; b=YGVl3Ioq4JCJCL3rwjVlSU/HlC DDUi2ZsmB+IBV2iSkL+kvuFgc9PJs0C0Ovika5puD+P8ihuvLEHxmUvpZfW0NDfb7HjIvgNrDBaJb E2osUjLS8iD7TMfwGkXuc1aKx7LLbrcxSIegqKFez6VjWOC6cWUdh8KlxFLASaKo2JZA=; 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=F9W1MzbwXxTnMI/g40XpiaYywfX3Yy1GmaLna7FLNes=; b=I/NgY6NGSaeWb+DHw6WB4aOg1M D0+FqVdgrc5yU7QRwvq30ccjeNPsOMPWQWq7qJgXPMy3Rog2tBaE++ZDNhnhm+UKeIu4VuU0nuyE1 83q0nzejLsP4P6rDXB0ZE3RZ8A+irlpV9mT7TfvaHCy3N5kYHqqa0K//beCtU2uHS0RU=; 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 1v6UIg-0002og-5c for openvpn-devel@lists.sourceforge.net; Wed, 08 Oct 2025 13:33:50 +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 598DXcBH023673 for ; Wed, 8 Oct 2025 15:33:38 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 598DXcqp023672 for openvpn-devel@lists.sourceforge.net; Wed, 8 Oct 2025 15:33:38 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 8 Oct 2025 15:33:31 +0200 Message-ID: <20251008133338.23652-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-1.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 At least on OpenBSD it seems that uintmax_t maps to unsigned long long always, but LargestIntegralType is unsigned long. So if we have a version of cmocka.h that defines LargestIntegralType then respe [...] 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: 1v6UIg-0002og-5c Subject: [Openvpn-devel] [PATCH v1] test_options_parse: Do not use uintmax_t instead of LargestIntegralType 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?1845420814982158834?= X-GMAIL-MSGID: =?utf-8?q?1845420814982158834?= From: Frank Lichtenheld At least on OpenBSD it seems that uintmax_t maps to unsigned long long always, but LargestIntegralType is unsigned long. So if we have a version of cmocka.h that defines LargestIntegralType then respect that. Change-Id: I59a49696acd665d43b21e5c23f24b86c15989cd6 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1256 --- 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/+/1256 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/tests/unit_tests/openvpn/test_options_parse.c b/tests/unit_tests/openvpn/test_options_parse.c index e552dd7..0ae37f5 100644 --- a/tests/unit_tests/openvpn/test_options_parse.c +++ b/tests/unit_tests/openvpn/test_options_parse.c @@ -198,14 +198,25 @@ &option_types_found, &es); } +/* compat with various versions of cmocka.h + * Older versions have LargestIntegralType. Newer + * versions use uintmax_t. But LargestIntegralType + * is not guaranteed to be equal to uintmax_t, so + * we can't use that unconditionally. So we only use + * it if cmocka.h does not define LargestIntegralType. + */ +#ifndef LargestIntegralType +#define LargestIntegralType uintmax_t +#endif + union tokens_parameter { - uintmax_t as_int; + LargestIntegralType as_int; void *as_pointer; }; static int -check_tokens(const uintmax_t value, const uintmax_t expected) +check_tokens(const LargestIntegralType value, const LargestIntegralType expected) { union tokens_parameter temp; temp.as_int = value;