From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id B5E981C62E for ; Mon, 14 May 2018 07:10:41 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Mon, 14 May 2018 13:10:37 +0800 Message-ID: <152627463797.53156.14788742298310653724.stgit@localhost.localdomain> In-Reply-To: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v4 14/23] rte_ether.h: explicit cast avoiding truncation warning 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: Mon, 14 May 2018 05:10:42 -0000 /projects/lagopus/src/dpdk/build/include/rte_ether.h:213:13: warning: conversion from 'int' to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion] addr[0] &= ~ETHER_GROUP_ADDR; /* clear multicast bit */ Signed-off-by: Andy Green --- lib/librte_net/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 27c919594..bee2b34f0 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -210,7 +210,7 @@ static inline void eth_random_addr(uint8_t *addr) uint8_t *p = (uint8_t *)&rand; rte_memcpy(addr, p, ETHER_ADDR_LEN); - addr[0] &= ~ETHER_GROUP_ADDR; /* clear multicast bit */ + addr[0] &= (uint8_t)~ETHER_GROUP_ADDR; /* clear multicast bit */ addr[0] |= ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */ }