[RFA record/replay] cast to avoid compiler warning

Andreas Schwab schwab@suse.de
Sun Oct 5 07:12:00 GMT 2008


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."



More information about the Gdb-patches mailing list