From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id F33ED7D52; Thu, 1 Nov 2018 20:45:58 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8D17D22199; Thu, 1 Nov 2018 15:45:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 01 Nov 2018 15:45:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=ULXnn/Ltvxb0BFJHYnao/T+Rp9qmv5gHxr8FlTPHfYA=; b=PoEbrTZRP5gD xQQdFpUTHNErHQyny/INm7c6p2KUAl9HYCnEJiyfFwt6uVf+g4+/TDCJQIcx3IdH F7if3w/DyKI9mQvBqEDZBGjbLtOxPiwU6HCdpgBPAklemsMTFw4pKGi9aXjljNFo qY+gfk3WyE9n2TQyLlB1SphrARsVHmM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=ULXnn/Ltvxb0BFJHYnao/T+Rp9qmv5gHxr8FlTPHf YA=; b=nd83+rJNnJeNjbMiRBZ2gUAUBBAEUQFURi/mFmsLCrrGJ9Wm/vo1KYgCl 7wMLy9jXqJCy8Lr8D0bZuJt8lfT/lj8eNwhDhmfPSVyJQiZA9DyHVXAPDQDLYq/G xkxx4DBf7/+zWB1+D+VBR1WJb/I6/Pybh529VG5+FvyTcT0/JFIbrYYlM9TCMBCl EZPgeCW2r2EbT76glt89+vOFSwpqIxn5SpfFi9JWqvPxySB5V+3Ucq9H9RbGZAio Iqu4vIR+5U9Bibdl31A0s9leXEedZZXOhj9YrqpJkgJwHec6yqBU4drX8+kadurO 6eEBi6kPDth73uRZ4I+6uYSjGV4hg== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C6236E4074; Thu, 1 Nov 2018 15:45:56 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Bruce Richardson , Stephen Hemminger , Hemant Agrawal , Shreyansh Jain , dev@dpdk.org, stable@dpdk.org Date: Thu, 01 Nov 2018 20:45:53 +0100 Message-ID: <2352543.cRkeIK1bzI@xps> In-Reply-To: References: <20181101131951.91459-1-ferruh.yigit@intel.com> <20181101174550.GA23396@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/2] bus/dpaa: fix build with gcc 9.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 19:45:59 -0000 01/11/2018 19:21, Ferruh Yigit: > On 11/1/2018 5:45 PM, Bruce Richardson wrote: > > On Thu, Nov 01, 2018 at 10:42:31AM -0700, Stephen Hemminger wrote: > >> On Thu, 1 Nov 2018 13:19:50 +0000 > >> Ferruh Yigit wrote: > >> > >>> build error: > >>> In function =E2=80=98fman_if_init=E2=80=99, > >>> .../drivers/bus/dpaa/base/fman/fman.c:186:2: > >>> error: =E2=80=98strncpy=E2=80=99 output may be truncated copying = 4095 bytes from a > >>> string of length 4095 [-Werror=3Dstringop-truncation] > >>> strncpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1); > >>> > >>> strncpy may result a not null-terminated string, > >>> replaced it with rte_strscpy > >>> > >>> Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations") > >>> Cc: stable@dpdk.org > >>> > >>> Signed-off-by: Ferruh Yigit > >> > >> Maybe just use strlcpy instead of a DPDK specific function. > >> That way if Gcc gets smarter it can check that as well. > >=20 > > +1 > > While I get the point of strscpy, if strlcpy is good enough for openbsd, > > it's good enough for me! :-) >=20 > I prefer strscpy but for both cases return value is not checked at all, s= o makes > hard to argue the benefit of the more proper return value J >=20 > So, as a rule of thumb are we saying strlcpy is dpdk preferred copy funct= ion? Yes