From patchwork Sat May 1 03:06:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1784 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id eJDqDIxSjWArWgAAIUCqbw (envelope-from ) for ; Sat, 01 May 2021 09:07:24 -0400 Received: from proxy7.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id sGGWDIxSjWD1XAAAovjBpQ (envelope-from ) for ; Sat, 01 May 2021 09:07:24 -0400 Received: from smtp38.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.ord1d.rsapps.net with LMTPS id QAKoC4xSjWBqJQAAMe1Fpw (envelope-from ) for ; Sat, 01 May 2021 09:07:24 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp38.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 2b4c7b38-aa7e-11eb-afb4-525400f6a58b-1-1 Received: from [216.105.38.7] ([216.105.38.7:57484] helo=lists.sourceforge.net) by smtp38.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 7C/A8-08323-B825D806; Sat, 01 May 2021 09:07:24 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lcpKY-0003PF-2x; Sat, 01 May 2021 13:06:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lcpKT-0003Ow-1x for openvpn-devel@lists.sourceforge.net; Sat, 01 May 2021 13:06:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: 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=Slq6B31FhTcZWtQJVddJgx4Libv8mqoKcDO3ss+XQGI=; b=ErxRvAorQFXYeW5KFNCWI4Ls5r jr2U7/Q7fuVkSd14LPABGURzVLw4rJBAxkOj2CvekjOFGUHjnKmxAajPczpJ6CK4W5jf8g6QzxCs8 foj8tbZpF2I6M32Xzglf3RMoUls9e5LceneghexFBQh9RguUx3KzlBkdT7xLobhWWF8o=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=Slq6B31FhTcZWtQJVddJgx4Libv8mqoKcDO3ss+XQGI=; b=QV1gD9kenZeBShYGc5uxeBRn/m RGDEMAgjCpylIShDsISO0vlLj7a4767m1BCuvt0XpyZQ8GZtheWSbuKrf5ZPGiYBgM5vpbAiWlOCF xA8Ompexs0XRH/mfiiJxTbugJXBTKPf7OGYF8jrhn959hXRyKLuqb5dJTDzSWIS3dcU4=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lcpKL-0001vR-1C for openvpn-devel@lists.sourceforge.net; Sat, 01 May 2021 13:06:40 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 1 May 2021 15:06:38 +0200 Message-Id: <20210501130640.9330-2-a@unstable.cc> In-Reply-To: <20210501130640.9330-1-a@unstable.cc> References: <20210501130640.9330-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: openvpn.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lcpKL-0001vR-1C Subject: [Openvpn-devel] [PATCH 1/3] windows: use appropriate and portable format specifier for 64bit pointer 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: , Cc: Antonio Quartulli , Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Antonio Quartulli To print a 64bit poiner, fprintf() must be provided with the appropriate format specifier. The most portable in this case is PRIx64, which is redefined accordingly on each platform. It comes from inttypes.h and it's the recommended way to print a 64bit long hex value. Fixes various warnings of this type: event.c: In function ‘we_ctl’: event.c:235:24: warning: 'I' flag used with ‘%x’ gnu_printf format [-Wformat=] 235 | dmsg(D_EVENT_WAIT, "WE_CTL n=%d ev=%p rwflags=0x%04x arg=" ptr_format, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error.h:151:68: note: in definition of macro ‘dmsg’ 151 | #define dmsg(flags, ...) do { if (msg_test(flags)) {x_msg((flags), __VA_ARGS__);} EXIT_FATAL(flags); } while (false) | ^~~~~~~~~~~ event.c:235:24: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘long long unsigned int’ [-Wformat=] 235 | dmsg(D_EVENT_WAIT, "WE_CTL n=%d ev=%p rwflags=0x%04x arg=" ptr_format, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...... 239 | (ptr_type)arg); | ~~~~~~~~~~~~~ | | | long long unsigned int Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/common.h b/src/openvpn/common.h index 544fa238..6575bcb7 100644 --- a/src/openvpn/common.h +++ b/src/openvpn/common.h @@ -44,7 +44,7 @@ typedef int interval_t; * Printf formats for special types */ #ifdef _WIN64 -#define ptr_format "0x%I64x" +#define ptr_format "0x%016" PRIx64 #else #define ptr_format "0x%08lx" #endif