From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: 32-bit compilation & debug logs Date: Tue, 13 Feb 2018 21:59:05 +0100 Message-ID: <1626400.QN1GMNLe81@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit To: dev@dpdk.org Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 493611B309 for ; Tue, 13 Feb 2018 21:59:16 +0100 (CET) Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 95146246D5 for ; Tue, 13 Feb 2018 15:59:15 -0500 (EST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi all, There is a very common pattern with build failures in DPDK. When compiling in 32-bit mode, there are some mismatches between printf format "%lu" / "%lx" and the size of the data being 64-bit. In 32-bit mode, a long is 32 bits long :) That's why "%lx" must be replaced by "%" PRIx64. long -> %lx uint64_t -> %PRIx64 Most of the times, using %l is wrong (except when printing a long). So next time you write %l, please think "I am probably wrong". For the existing codebase, please grep "%l". There are probably some remaining wrong "%l" which are not detected when compiling, because the code is in debug functions never enabled. Note that debug code should be tested but there can be some forgotten code paths. Thanks