From patchwork Thu May 17 13:49:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 40148 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D2C672FA; Thu, 17 May 2018 15:49:08 +0200 (CEST) Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 794B172FA for ; Thu, 17 May 2018 15:49:06 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Thu, 17 May 2018 21:49:02 +0800 Message-ID: <152656494207.46638.7698825480823239153.stgit@localhost.localdomain> In-Reply-To: <152656480225.46638.3271983577765861155.stgit@localhost.localdomain> References: <152656480225.46638.3271983577765861155.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Subject: [dpdk-dev] [PATCH v5 02/21] rte_string_fns.h: fix gcc8.1 sign conv warning in lstrcpy 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In file included from ./dpdk/dpdk.c:88: /projects/lagopus/src/dpdk/build/include/rte_string_fns.h: In function 'rte_strlcpy': /projects/lagopus/src/dpdk/build/include/rte_string_fns.h:58:9: warning: conversion to 'size_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] return snprintf(dst, size, "%s", src); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Acked-by: Bruce Richardson --- lib/librte_eal/common/include/rte_string_fns.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/include/rte_string_fns.h b/lib/librte_eal/common/include/rte_string_fns.h index fcbb42e00..97597a148 100644 --- a/lib/librte_eal/common/include/rte_string_fns.h +++ b/lib/librte_eal/common/include/rte_string_fns.h @@ -55,7 +55,7 @@ rte_strsplit(char *string, int stringlen, static inline size_t rte_strlcpy(char *dst, const char *src, size_t size) { - return snprintf(dst, size, "%s", src); + return (size_t)snprintf(dst, size, "%s", src); } /* pull in a strlcpy function */