[CRIU] [PATCH 14/23] cr: introduced the macro P() to convert an integer to unsigned long

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 14 07:02:04 EST 2013


On 01/14/2013 03:46 PM, Pavel Emelyanov wrote:
> If we can fix this by using the standard %Lx (can we?) this is OK

If we use %Lx instead of %lx we will break x86 build.
Consider the following program modelling our case:

#include <stdio.h>
#include <inttypes.h>

int main() {
uint64_t v;

v = 1;
printf("%Lx\n", v);

return 0;
}

Compilation fails on x86:

printf.c: In function ‘main’:
printf.c:8:2: error: format ‘%Lx’ expects argument of type ‘long long 
unsigned int’, but argument 2 has type ‘int64_t’ [-Werror=format]

while it succeeds on ARM.

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