From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 03/24] rte_common.h: cast gcc builtin result to avoid complaints Date: Sun, 13 May 2018 22:40:00 +0200 Message-ID: <2487048.egYbSRWGYj@xps> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609033730.121661.15300461327237900961.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, stable@dpdk.org To: Andy Green Return-path: In-Reply-To: <152609033730.121661.15300461327237900961.stgit@localhost.localdomain> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 12/05/2018 03:58, Andy Green: > /projects/lagopus/src/dpdk/build/include/rte_common.h:416:9: > warning: conversion to 'uint32_t' {aka 'unsigned int'} from > 'int' may change the sign of the result [-Wsign-conversion] > return __builtin_ctz(v); > ^~~~~~~~~~~~~~~~ > > The builtin is defined to return int, but we want to > return it as uint32_t. Its only defined valid return > values are positive integers or zero, which is OK for > uint32_t. So just add an explicit cast. Fixes: 03f6bced5bba ("eal: use intrinsic function") Cc: stable@dpdk.org > Signed-off-by: Andy Green Applied, thanks