From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 06/24] /lib/librte_eal: stage cast from uint64 to long Date: Sun, 13 May 2018 18:24:03 +0200 Message-ID: <3918757.SVKzEjPn4h@xps> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609035240.121661.17896359108855967217.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Andy Green Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 420151D098 for ; Sun, 13 May 2018 18:24:05 +0200 (CEST) In-Reply-To: <152609035240.121661.17896359108855967217.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: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.