From patchwork Thu Mar 12 07:41:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4816 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:2755:b0:83c:d90d:321 with SMTP id j21csp358357maq; Thu, 12 Mar 2026 00:41:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUwDxVZU68Yiae3G2Pl8VmZwM1wVLj3/HzkcOByhSKilY0lJ+GwoOFW42usPdUVGd50kRPTd3xdGKM=@openvpn.net X-Received: by 2002:a05:7300:1348:b0:2be:1f56:ed23 with SMTP id 5a478bee46e88-2be8a275bb0mr2201107eec.7.1773301308576; Thu, 12 Mar 2026 00:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773301308; cv=none; d=google.com; s=arc-20240605; b=BmaxO4O/Jx5VdN4W/OzlOL0CBxMXey2FvCTQ2/ezuUzL+m8I7cXo4mh9qpBFJ3NszR ie0s+oBR8ZnYcWNE7DxGSixE+lT136g3LdyknkWe9aChMyGFkn//pDwU81HOmTzbcC87 UfMEH831ere1kmzJU3YNON8zsMkwEl6/NQPeyMX5+5mCm7jCWlFhK4rlcvycrlF13O64 aYHlSF3AMJQ3xDMQs/lNV1IvPD77cNuSBxRig4PzGgLKc1V1cdY8Z249c0Qquz8enQEq 66HnrnPpsxixTsAXiUZpbrJZnIz17x4EYkEfZ3YEbAZQLgn5x/4ulhf53r9lv7guF8a/ jpMA== 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=LrWX+fFCPRIWIkEH/MbBKVg4GgVLy7TEUBmNcYKGylQ=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Ksh5OwHfj9JyzeXJ3c/CqnPs/S34bUU2YlXPDxZMU7566Aw3h7ZEgfHEu1+/LjfdGl nZbhejVjQtbDixoCaVyBOLsb0RIZgLY9oUs5vSYZ6dumHB0FWYlcR0RicSmaG55CWLqm 4Sag4JayfCx4++LGQZIW2Dn/l4fS1pp4UQdJZhTeCX2i2DRSX60S+qyAH2J95zvaqm6c tU18oZpbemUAqYVIbEpA2bsnwy1F9evNUrSpcgvADTh9JgokV446c+JBVxbC/j+U+9wv N7NkORx9qO6TFCLf4jN2i0WRlokxjO8c/P4KlaaRrBWKA7DB7N8UEgVjxhjZRuCyD8x2 mJkQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=g6OQHVah; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=D7eTFL7S; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="AbNy3u/q"; 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 5a478bee46e88-2be8aadcb11si9264382eec.74.2026.03.12.00.41.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2026 00:41:48 -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=g6OQHVah; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=D7eTFL7S; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="AbNy3u/q"; 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=LrWX+fFCPRIWIkEH/MbBKVg4GgVLy7TEUBmNcYKGylQ=; b=g6OQHVahEmo7Vqn5nd9mO4js06 Nbwtbnnnd1BbtJLzR+obSvrSPAUJ2YGVtWMsJ9re+PN46PHk0OmPF+RW7cNY4pjd7z2sJ8Ynx0lLZ NhoVvtY/yqCsaVGuQuyhRE/Uon64v7mz4BoQ4G07PHls2iV3zX5nz03ccTBhvVk9pY64=; 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 1w0afv-0000XT-QJ; Thu, 12 Mar 2026 07:41:43 +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 1w0afk-0000XD-2V for openvpn-devel@lists.sourceforge.net; Thu, 12 Mar 2026 07:41:32 +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=Ky9a70SXP0TBrDZwWWhvRa5+rY3SFZjwCxw7U+CCjg8=; b=D7eTFL7SrbSV5g4qOq4iORCHtY GjC81H1xmHwtKI8TpqkpzJiYqA83+VhWf2KxekuQ+W8nLm5pwo3fCzegGw4ymIwxizYj0EH/sSVMy /yUu1M87yIRnfUsIc1zNRX9WyTdR9qWB2zW57BQmucpNH0p2hx5Qlzy6On/DY0jxAvgY=; 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=Ky9a70SXP0TBrDZwWWhvRa5+rY3SFZjwCxw7U+CCjg8=; b=AbNy3u/qT71mxNRVrR2vSrEVy8 LreN4HBHH5YpvLCxsfyDhMEhqKNLFEzTuSnpHATLemotQSB2o2r9tb6SN8yPO6kfoR2JHI09RGHIv nS9M7wPa7M6KZKNrQ3VxFPxG5RQKBggiTduASrdsCvYZsIBxAhatcmIUJeQuLO6jNZ2I=; Received: from [193.149.48.129] (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 1w0afj-000369-5e for openvpn-devel@lists.sourceforge.net; Thu, 12 Mar 2026 07:41:31 +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 62C7fOTF030852 for ; Thu, 12 Mar 2026 08:41:24 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 62C7fOda030851 for openvpn-devel@lists.sourceforge.net; Thu, 12 Mar 2026 08:41:24 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 12 Mar 2026 08:41:18 +0100 Message-ID: <20260312074123.30838-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.0 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 While here also mark a comparison we know is safe with an explicit cast. Change-Id: I96b6acffd7e5149d4c9488a06e43c62711b31cfc 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: 1w0afj-000369-5e Subject: [Openvpn-devel] [PATCH v7] error: Use SOCKET_UNDEFINED instead of -1 to avoid sign error on Windows 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?1859441192696020441?= X-GMAIL-MSGID: =?utf-8?q?1859441192696020441?= From: Frank Lichtenheld While here also mark a comparison we know is safe with an explicit cast. Change-Id: I96b6acffd7e5149d4c9488a06e43c62711b31cfc Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1501 --- 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/+/1501 This mail reflects revision 7 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/error.c b/src/openvpn/error.c index 6fb4f32..2900352 100644 --- a/src/openvpn/error.c +++ b/src/openvpn/error.c @@ -97,15 +97,10 @@ forked = true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - bool set_debug_level(const int level, const unsigned int flags) { - if (level >= 0 && level <= M_DEBUG_LEVEL) + if (level >= 0 && (unsigned int)level <= M_DEBUG_LEVEL) { x_debug_level = (msglvl_t)level; return true; @@ -118,10 +113,6 @@ return false; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - bool set_mute_cutoff(const int cutoff) { @@ -621,11 +612,6 @@ x_cs_verbose_level = verbose_level; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /* * Called after most socket or tun/tap operations, via the inline * function check_status(). @@ -674,15 +660,22 @@ { if (extended_msg) { - msg(x_cs_info_level, "%s %s [%s]: %s (fd=" SOCKET_PRINTF ",code=%d)", description, - sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "", extended_msg, - openvpn_strerror(my_errno, crt_error, &gc), sock ? sock->sd : -1, my_errno); + msg(x_cs_info_level, "%s %s [%s]: %s (fd=" SOCKET_PRINTF ",code=%d)", + description, + sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "", + extended_msg, + openvpn_strerror(my_errno, crt_error, &gc), + sock ? sock->sd : SOCKET_UNDEFINED, + my_errno); } else { - msg(x_cs_info_level, "%s %s: %s (fd=" SOCKET_PRINTF ",code=%d)", description, + msg(x_cs_info_level, "%s %s: %s (fd=" SOCKET_PRINTF ",code=%d)", + description, sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "", - openvpn_strerror(my_errno, crt_error, &gc), sock ? sock->sd : -1, my_errno); + openvpn_strerror(my_errno, crt_error, &gc), + sock ? sock->sd : SOCKET_UNDEFINED, + my_errno); } if (x_cs_err_delay_ms) @@ -694,10 +687,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* * In multiclient mode, put a client-specific prefix * before each message.