[dpdk-dev] [PATCH v3 06/24] /lib/librte_eal: stage cast from uint64 to long

Andy Green andy at warmcat.com
Mon May 14 01:17:06 CEST 2018



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

> 
> 


More information about the dev mailing list