Re: [RFA record/replay] cast to avoid compiler warning

Andreas Schwab
2008-10-05T07:12:12Z

Mark Kettenis <mark.kettenis@xs4all.nl> writes:

>> Date: Sat, 04 Oct 2008 11:42:47 -0700
>> From: Michael Snyder <msnyder@vmware.com>
>>
>> Sizeof returns size_t, which is not always the same as int.
>> This cast will prevent compiler warnings on some architectures
>> (eg. x86_64)
>
> This is wrong! Better cast to unsigned long and print as %lu.

The value will always be a small number.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃŸe 5, 90409 NÃ¼rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."