923a60
From 10a1adc237ada061f557a7ae422456aa7d8c2c05 Mon Sep 17 00:00:00 2001
923a60
From: Jan Synacek <jsynacek@redhat.com>
923a60
Date: Thu, 7 Sep 2017 14:41:09 +0200
923a60
Subject: [PATCH] Redefine 32bit time_t format to signed
923a60
MIME-Version: 1.0
923a60
Content-Type: text/plain; charset=UTF-8
923a60
Content-Transfer-Encoding: 8bit
923a60
923a60
It seems that it is signed both on i386 and arm.
923a60
923a60
Avoids a stupid gcc warning on arm:
923a60
923a60
src/udev/udevadm-monitor.c: In function ‘print_device’:
923a60
src/udev/udevadm-monitor.c:44:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘__time_t {aka long int}’ [-Wformat=]
923a60
         printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
923a60
                ^
923a60
923a60
(cherry picked from commit 6307c39b94344b901c1d6e0df7ee58644a8809bf)
923a60
923a60
Related: #1447937
923a60
---
923a60
 src/shared/util.h | 2 +-
923a60
 1 file changed, 1 insertion(+), 1 deletion(-)
923a60
923a60
diff --git a/src/shared/util.h b/src/shared/util.h
923a60
index f1b6c348f8..80ad18c0ad 100644
923a60
--- a/src/shared/util.h
923a60
+++ b/src/shared/util.h
923a60
@@ -72,7 +72,7 @@
923a60
 #if SIZEOF_TIME_T == 8
923a60
 #  define PRI_TIME PRIi64
923a60
 #elif SIZEOF_TIME_T == 4
923a60
-#  define PRI_TIME PRIu32
923a60
+#  define PRI_TIME "li"
923a60
 #else
923a60
 #  error Unknown time_t size
923a60
 #endif