[CRIU] [PATCH 5/9] print_hex_l: specify the size of the argument explicitly

Alexander Kartashov alekskartashov at parallels.com
Thu Jan 17 01:23:56 EST 2013


On 01/16/2013 09:56 PM, Pavel Emelyanov wrote:
> On 01/16/2013 09:18 PM, Alexander Kartashov wrote:
>> On 01/16/2013 07:33 PM, Pavel Emelyanov wrote:
>>> This breaks log-simple's formats compatibility.
>> Is it OK to retain the prototype but cast the argument to uint64_t?
> No. Use
>
> #if BITS_PER_LONG==64
>
> and declare BITS_PER_LONG somewhere in the header as
>
> #define BITS_PER_LONG (sizeof(unsigned long) * 8)

This won't work because sizeof(unsigned long) is expanded after the 
preprocessor pass.
If we want to use the macro BITS_PER_LONG we have to define its value 
explicitly
but in this case I don't see much difference from using the macro 
CONFIG_X86.

-- 
Sincerely yours,
Alexander Kartashov

Intern
Core team

www.parallels.com

Skype: aleksandr.kartashov
Email: alekskartashov at parallels.com



More information about the CRIU mailing list