From patchwork Tue Oct 28 18:39:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4536 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:2995:b0:72f:f16c:e055 with SMTP id f21csp2246802max; Tue, 28 Oct 2025 11:39:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpT8fUNo0LRe0bxJoQx9h8N/7sxzT3FpiCM5FIVdMyr60RkdA1ZEZJaSiBnkgZasiGOmIXZDY9p1M=@openvpn.net X-Google-Smtp-Source: AGHT+IGA9H6+aRA04FEEt5/tcGuqmvEi51dB5Dlz4HmssoKXGbS3cD2i1G26snCzKktuHy1bzJQf X-Received: by 2002:a05:6870:ac0e:b0:3d3:599d:fe98 with SMTP id 586e51a60fabf-3d747801999mr189709fac.41.1761676798333; Tue, 28 Oct 2025 11:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761676798; cv=none; d=google.com; s=arc-20240605; b=LUi7q20akmoyLr1TAuJod5lti9ThXiOr+1/IxzaRUlafTPGiC9DxzvukGrpdRjNU4+ c323ANvv08PXVQCMSOE5HW+dlIhoxSOeSF9XCm8/v/Dus4rpTu5rNOzf5+qGSWWsvwRi lLLiM+NmOuePVRYpJGHfTl4UyADiqrdc0j4G7Y7VG163lLqmcVDom8kmUgy3xZApa4s1 vsYtebFQhYEjjuLqDdkc8FYorx8ccLV0hLz8KmS4cchM3sh97AHh5O4MdgnCBbuQQM1v Mz+a6dqV2U81fuvp8Kt2nIf1n8cGpUF+Z8+hRY51PIwADf4+uJXMxCgfa33u456CJU/0 gddw== 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=d5IRUzcGUYG6wB5m6sOOMLcnCCMxShD8enzWc//YjN4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=XDFXP23QZ4GONnBx0IOPXir5vFR0Aq/lPE/ncxhr9bt6an2bbUFGGQ7/gL414DlvFu 0+3BSfNzpJSu6dsVxsl5awbqfBrtcd0pAh/ocmeVhsXPZcYf5wnwYnDGaCM2fqXGOKZo zsWzYdM3INjicTWGHuYgRbC0u1a8zSplao3XcPyVYKDyTdwEdkfChBUPGmIMN1gMDT4J wu6TM8TO0MPHC+oaI+M4khanvkErVYpTRfFm8s682Phn0IncC8exbWPuiVDGJey1IxRd GW0FwnxAEetfxMjESkDl4i2lZGcxMSPHSbHoUEo7zCSb2rZyUjg9HGqiDOqhu/54E3Sj RSBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Q5BVRPlR; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=eJoyJF5u; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GccC4YPD; 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 586e51a60fabf-3d20192497esi3440378fac.87.2025.10.28.11.39.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Oct 2025 11:39:58 -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=Q5BVRPlR; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=eJoyJF5u; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GccC4YPD; 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=d5IRUzcGUYG6wB5m6sOOMLcnCCMxShD8enzWc//YjN4=; b=Q5BVRPlRFQJzQgu8IhNvIyGBtz lzNRdM4gy05JQeLq8I7gpCx6AeAPg5jFnN8tCXx4XESm/GUZgjXC+Xq7M9pQs85OdSMfRzuEVkG96 Da2TmbJS6kZpyQ0mregp9iQ1lh4wFjpNdMPEp7PiyX6hPP2pNtmizePb034YhpGtqoV4=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vDobr-0006tv-Ks; Tue, 28 Oct 2025 18:39:55 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vDobq-0006to-0k for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 18:39:54 +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=SukosiSWV/0RMzjH7Iw6oNW4r1mt/VT0tewB9brMbo0=; b=eJoyJF5umnlnuQEjzbwoSmf8rk eui59Km1jdxOUxoLP79q9chZqJRv2/vMKWWU5BoInM7MXk6ECj/999wrD39tO7attvXK9FjyViw+1 ylcg9UaFErdReKpivdxX7YSYtxcyLrRatNERK8siNKN9WExLesC0yF2WA+r1lNH6qE2g=; 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=SukosiSWV/0RMzjH7Iw6oNW4r1mt/VT0tewB9brMbo0=; b=GccC4YPDX8hdfX/jg9/Y1VCTaZ 1ISZ35OVcmFj9ufzcwPK4c1F3Zx/TNd50VbYs6HMr45ooBBq/tvgtpBP+l0BZbfCtfoZu0QwUevem 26uPpr7rKboxedyxeSf21jr1u7FpGGICuVj9R3Y/57Wm94NNfDdJHT+yx2RH7aH2MZ6A=; 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 1vDobo-00087g-Na for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 18:39:53 +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 59SIdj3J031920 for ; Tue, 28 Oct 2025 19:39:45 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 59SIdjwf031919 for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 19:39:45 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Oct 2025 19:39:35 +0100 Message-ID: <20251028183945.31901-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 We know these casts are safe, so make them explicit. Change-Id: I2554b9baec6af191b0adb137e64124586dc4331c 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: 1vDobo-00087g-Na Subject: [Openvpn-devel] [PATCH v2] gremlin: Avoid some conversion warnings 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?1847252010431104441?= X-GMAIL-MSGID: =?utf-8?q?1847252010431104441?= From: Frank Lichtenheld We know these casts are safe, so make them explicit. Change-Id: I2554b9baec6af191b0adb137e64124586dc4331c Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1286 --- 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/+/1286 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/gremlin.c b/src/openvpn/gremlin.c index 0e5e93f..a3dbff1 100644 --- a/src/openvpn/gremlin.c +++ b/src/openvpn/gremlin.c @@ -98,11 +98,6 @@ return (get_random() % n) == 0; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /* * Return uniformly distributed random number between * low and high. @@ -112,7 +107,7 @@ { int ret; ASSERT(low <= high); - ret = low + (get_random() % (high - low + 1)); + ret = low + (int)(get_random() % (high - low + 1)); ASSERT(ret >= low && ret <= high); return ret; } @@ -195,7 +190,7 @@ { if (buf->len > 0) { - uint8_t r = roll(0, 255); + uint8_t r = (uint8_t)roll(0, 255); int method = roll(0, 5); switch (method) @@ -235,8 +230,4 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - #endif /* ifdef ENABLE_DEBUG */