From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Green Subject: Re: [PATCH v3 06/24] /lib/librte_eal: stage cast from uint64 to long Date: Mon, 14 May 2018 07:17:06 +0800 Message-ID: References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609035240.121661.17896359108855967217.stgit@localhost.localdomain> <3918757.SVKzEjPn4h@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id E4FE21BC40 for ; Mon, 14 May 2018 01:17:10 +0200 (CEST) In-Reply-To: <3918757.SVKzEjPn4h@xps> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 05/14/2018 12:24 AM, Thomas Monjalon wrote: > 12/05/2018 03:59, Andy Green: >> warning: conversion to 'uint64_t' {aka 'long unsigned int'} >> from 'long int' may change the sign of the result >> [-Wsign-conversion] >> val = lrand48(); >> ^~~~~~~ > [...] >> rte_rand(void) >> { >> uint64_t val; >> - val = lrand48(); >> + val = (unsigned long)lrand48(); > > I think the right cast is uint64_t. > It makes a difference in 32-bit environment. Yes, you are right thanks. I changed it accordingly. -Andy > >