From patchwork Mon Sep 28 14:15:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5413 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:5189:b0:8b3:6e77:b38b with SMTP id g9csp3356703mae; Mon, 28 Sep 2026 07:16:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBzVN7H9zfdPcIl20l7mXEPiTwEYlW+MAXrgH15sQhwsz9srdZVfnqLhin8UeKmnK23JNKxG4gloL4U=@openvpn.net X-Received: by 2002:a05:6808:f90:b0:4e7:a6e3:7338 with SMTP id 5614622812f47-4e7a6e3883fmr4309867b6e.17.1790604982123; Mon, 28 Sep 2026 07:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790604982; cv=none; d=google.com; s=arc-20260327; b=MPupXY9mDvsJOtx8I5mRcHm0t4pb9WWzm+LYMc5Yw6bY5vIolZsewcOfVL+zim6Hxn Kp1F+4lvIjuX2ZnwlRriIfDfyEpfTevcSEHjlJjrJE23JaLVZkDJDhWkoNXuVRsGzlsz mNzcX+7eMeh0daJ3tRT2SA3kIUTOrIvRNlNRqxWx/ZbkFbHMN3BxROV9Mv3ODfB5PSf/ ALc/CM2foQIACZSxfISOQAMUuYwStwOY+p1tlGjNIvEcq3eHxt/4r5Aj5H0TqJyNA0PU wBkqMnz0zCyGrKkKDAdjpTk4hRD2PYRWIYctP0ScKqn8yjnwlnhWkY1ScY342LiiHbwT zDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=owTlKF72y3sfaiXn3JVFu2pMCp7O30U/hVrkloh3Eig=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=JFoA/OMefDEqWOvqzB7vbtgaLtvNYN+Bez7M0h4OdRKGVx1wwroRoK9mIqbYSVdiMC 9czWIcditTtrLLeogPNVz1zPK2MBLVguYv+SznklZjz5kEkkx9/D+mQRwZDnWMkkyddI XQWGGTSBotVSNval+dH4HBrgorJy9V7QcCL36XnFTGUGUsQ1NC7BLjVUQzruyZgSmIK2 YFpMmOUwcVNOHgeVZ4LXd1+gA/G0XkiOSfjX6CCYUZ+pzaoFpXqXkCX7OG4bjjQClAuF L9C8KVHUZvB3H4G2FzTPcjT1etgP1DY4xYue01P0n6RfxhOyXanBMBF/ZENahQaDd/lp aGVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=nNihtSaE; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=IDB+aMB7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KGp4x0+2; 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-4933586ebfbsi17517587fac.140.2026.09.28.07.16.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2026 07:16:21 -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=nNihtSaE; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=IDB+aMB7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KGp4x0+2; 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=owTlKF72y3sfaiXn3JVFu2pMCp7O30U/hVrkloh3Eig=; b=nNihtSaEw6DqFpTH33a+zcYFlp 9wQ8lo6pf2ssQAoRXxJ4WXw/U849za1T6T6GIcmdORavf+HUa0iQdjDwvgPfmaNazZMBoQXkWgcGV N+6OnSw5meKV9pRjW64Zjw1DGndmYJpwQnFVBvnn0gKzai9ArKWxYy2PiwXOevQIIOu4=; 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 1xBC9S-000124-05; Mon, 28 Sep 2026 14:16:18 +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 1xBC9P-00011p-Mg for openvpn-devel@lists.sourceforge.net; Mon, 28 Sep 2026 14:16:15 +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=wVMCPeGpt5JC6o82DiEJR+1VVLeMxlEJ6xmammSowOs=; b=IDB+aMB7P365dHf9GdC2btMSMw pz+Qgcm4WfZmi/0R4iCq5t0el9HPpcydvnD1EmxdLqnOHPIAvK6FbjK5zMv4tIx3D9GxxpuYmyA5n vufO6gFWgdznJlXep4Zjj8sDDoQTEGDG273EKtcazguw4AMIjke9pWtdMYzcsYbthZSs=; 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=wVMCPeGpt5JC6o82DiEJR+1VVLeMxlEJ6xmammSowOs=; b=KGp4x0+2VSuqWYQ7BNchMdvk/w Y+xolS00keuwQI7kYO78zAzH8eUZyUAOFKlSuDCxxasqTsJr/96t9XF0TWq4YDXVzPTH9TBEgXbMp falqsABvlEIvNad5dyk2UukSaXQ56BD10irB6bRkHbzDqnsD6GDMh8idpLqcJckhqJp8=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1xBC9G-0006W1-RB for openvpn-devel@lists.sourceforge.net; Mon, 28 Sep 2026 14:16:09 +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 68SEFx2u011906 for ; Mon, 28 Sep 2026 16:15:59 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 68SEFxvG011905 for openvpn-devel@lists.sourceforge.net; Mon, 28 Sep 2026 16:15:59 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 28 Sep 2026 16:15:53 +0200 Message-ID: <20260928141559.11880-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.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-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 Since we do not force __GNUC__ to undefined on Windows (since we want to support MinGW) cppcheck might stumble upon __builtin_expect(). When running with gnu.cfg (which we do not want to do for Window [...] 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: 1xBC9G-0006W1-RB Subject: [Openvpn-devel] [PATCH v1] cppcheck: Fix handling of likely() 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: 1877585409788988591 X-GMAIL-MSGID: 1877585409788988591 From: Frank Lichtenheld Since we do not force __GNUC__ to undefined on Windows (since we want to support MinGW) cppcheck might stumble upon __builtin_expect(). When running with gnu.cfg (which we do not want to do for Windows code) then that has an existing override. But for our Windows checks we need to add our own override. This caused false-positives in buffer code. Change-Id: I3b835558451414d8a4e8058114643555be69d391 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1957 --- 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/+/1957 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/dev-tools/openvpn-cppcheck-windows.cfg b/dev-tools/openvpn-cppcheck-windows.cfg new file mode 100644 index 0000000..9ac7282 --- /dev/null +++ b/dev-tools/openvpn-cppcheck-windows.cfg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh index 6b2c2be..3c71c83 100755 --- a/dev-tools/run-cppcheck.sh +++ b/dev-tools/run-cppcheck.sh @@ -49,7 +49,7 @@ tests/unit_tests/plugins/ || ret=$? cppcheck $COMMON_ARGS \ --platform=win64 \ - --library=windows.cfg \ + --library=windows.cfg --library=${SCRIPT_DIR}/openvpn-cppcheck-windows.cfg \ -D_WIN32 \ -UTARGET_LINUX -UTARGET_FREEBSD -UTARGET_OPENBSD -UTARGET_NETBSD \ -UTARGET_DARWIN -UTARGET_ANDROID -UTARGET_SOLARIS -UTARGET_DRAGONFLY \