From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 44EEA1CF5D for ; Sun, 13 May 2018 19:02:57 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E0A8725BAE; Sun, 13 May 2018 13:02:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 13 May 2018 13:02:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=E3cyAkcUksG6axDuAwH2g5D7f6 QSR6oF6OYD2gJG+OA=; b=TkhpcYP4QphDe+wnDE08rBwBMpD4ajWMmEfLQ0vzLJ KFvo41+65CjrnStlmR9FzQ+3dlX5ai+kACWV8wWQSkgwkccbdWxOm3qWxSScpTrG yRz34m2OKV+NPwJ7W8rdu3hNMOVT+XnpKxIWBR6w6n1kDhhQIlGvS28s8mV0LGJM E= 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=E3cyAk cUksG6axDuAwH2g5D7f6QSR6oF6OYD2gJG+OA=; b=gWT2jqpPKmuq8aGtCAC0eK +lK8uKKWB73FdtV52XQUvYnKVZlKw+/0zXsxZA3+mURvAx8ZMR7fo8GCqOzW7KbV JhGg2n7yEc1Yp2kE/340xGjiXfVx2UzoYeKsx6c+aaWnG5Ad/6Il/vLDRka/ItSE 5+ue5YsETNB1lPCHcp6DypAnJFfHYzLXW7zNAJ7g52V4cGhejh/qUmJaE1ACR2Jl WcjpEPtHscjbrzLBu8Os5t/WA2CPiMry9nVcIOfMxua2Wl2qdzgAqjaZj6iN5Z6X hojPETuj4D65dKO9uQ71e4jOyFymkhhwqBLIFOXVCG+9UpjfF0QDW/nStk2FNNDg == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 54A2AE4855; Sun, 13 May 2018 13:02:56 -0400 (EDT) From: Thomas Monjalon To: Andy Green Cc: dev@dpdk.org Date: Sun, 13 May 2018 19:02:55 +0200 Message-ID: <1894250.mJgVCb3rkv@xps> In-Reply-To: <152609041278.121661.12065395526931802948.stgit@localhost.localdomain> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609041278.121661.12065395526931802948.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 18/24] 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: Sun, 13 May 2018 17:02:57 -0000 12/05/2018 04:00, Andy Green: > /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 */ [..] > 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 */ ETHER_GROUP_ADDR and ETHER_LOCAL_ADMIN_ADDR are defined macros, they have no type, so I don't understand the need for casting. And I don't understand why it is not needed for ETHER_LOCAL_ADMIN_ADDR.