From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/2] rte_mbuf: fix strncpy warnings Date: Wed, 04 Apr 2018 17:35:42 +0200 Message-ID: <1836809.Bf90Dp1qdv@xps> References: <20180329170531.2478-1-stephen@networkplumber.org> <20180329170531.2478-2-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 741781C753 for ; Wed, 4 Apr 2018 17:35:44 +0200 (CEST) In-Reply-To: <20180329170531.2478-2-stephen@networkplumber.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/03/2018 19:05, Stephen Hemminger: > Gcc-8 discovers issue with platform_mempool_ops. > rte_mbuf_pool_ops.c:26:3: error: =E2=80=98strncpy=E2=80=99 output truncat= ed before > terminating nul copying as many bytes from a string as its length > [-Werror=3Dstringop-truncation] > strncpy(mz->addr, ops_name, strlen(ops_name)); >=20 > Since the ops_name is already checked for size, using strncpy > here is unnecessary; just use strcpy. >=20 > Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions") > Signed-off-by: Stephen Hemminger Applied, thanks