From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 702D3A0548; Thu, 2 Jun 2022 12:21:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 288D140691; Thu, 2 Jun 2022 12:21:14 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 111B14021E; Thu, 2 Jun 2022 12:21:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654165272; x=1685701272; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=gY1ehCJ+z1mjRNvVvxjWVSF/HujcyKtJ5lkhV1joRig=; b=AAO8umoyrG8y5q11xDF12VDZn/fRnIrNpJU16dotnHOOteSoRp3qpBqv HckFbj3tYOgtTK0VdUQvsHITBmj2TGU718jJHEdSpPAqapCx7wG4lBEuW qqGwxP71NwS2dMD2SYbw1MQCxxpzOmqozVQ6zlV+/so5YMzEq22ju+La2 LVj1tgtaKQXRCRoPpKlor6INuqGGZ+VIVU489EOlpbtNegoVwOUaWpqYZ aD8HzNW5LS0faqB4sx8vJY67MRZUuwsuyzPTD33udoklgpiP/l3WgTqf8 tNREstPhqMg1FlM2UMVJxmqAs/K/m5iJjo2x+u5h2v8dkU/t9lCWoNUFC A==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="263541699" X-IronPort-AV: E=Sophos;i="5.91,270,1647327600"; d="scan'208";a="263541699" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 03:21:10 -0700 X-IronPort-AV: E=Sophos;i="5.91,270,1647327600"; d="scan'208";a="606772451" Received: from bricha3-mobl.ger.corp.intel.com ([10.55.133.25]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Jun 2022 03:21:09 -0700 Date: Thu, 2 Jun 2022 11:21:05 +0100 From: Bruce Richardson To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Wisam Jaddo Subject: Re: [PATCH 11/12] app/flow-perf: fix build with GCC 12 Message-ID: References: <20220518101657.1230416-1-david.marchand@redhat.com> <20220518101657.1230416-12-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220518101657.1230416-12-david.marchand@redhat.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, May 18, 2022 at 12:16:56PM +0200, David Marchand wrote: > GCC 12 raises the following warning: > > ../app/test-flow-perf/main.c: In function ‘start_forwarding’: > ../app/test-flow-perf/main.c:1737:28: error: ‘sprintf’ may write a > terminating nul past the end of the destination > [-Werror=format-overflow=] > 1737 | sprintf(p[i++], "%d", (int)n); > | ^ > In function ‘pretty_number’, > inlined from ‘packet_per_second_stats’ at > ../app/test-flow-perf/main.c:1792:4, > inlined from ‘start_forwarding’ at > ../app/test-flow-perf/main.c:1831:3: > [...] > > We can simplify this code and rely on libc integer formatting via > this system locales. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand Good idea. Acked-by: Bruce Richardson