[CRIU] [PATCH 4/8] print_hex_l: don't print more than 8 hex digits on a 32-bit machine

Alexander Kartashov alekskartashov at parallels.com
Fri Jan 18 02:08:35 EST 2013


This patch prevents compilation warnings about shift overflow on ARM.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 pie/log-simple.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/pie/log-simple.c b/pie/log-simple.c
index eb940c1..36c5c22 100644
--- a/pie/log-simple.c
+++ b/pie/log-simple.c
@@ -136,6 +136,7 @@ static void print_hex_l(unsigned long num)
 	hexdigit(num >> 24, &buf[11], &z);
 	hexdigit(num >> 28, &buf[10], &z);
 
+#if BITS_PER_ULONG == 64
 	hexdigit(num >> 32, &buf[9], &z);
 	hexdigit(num >> 36, &buf[8], &z);
 	hexdigit(num >> 40, &buf[7], &z);
@@ -144,6 +145,7 @@ static void print_hex_l(unsigned long num)
 	hexdigit(num >> 52, &buf[4], &z);
 	hexdigit(num >> 56, &buf[3], &z);
 	hexdigit(num >> 60, &buf[2], &z);
+#endif
 
 	z -= 2;
 	z[0] = '0';
-- 
1.7.10.4



More information about the CRIU mailing list