chiark / gitweb /
Redefine 32bit time_t format to signed
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 1 Mar 2016 17:08:02 +0000 (12:08 -0500)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:57 +0000 (10:12 +0200)
It seems that it is signed both on i386 and arm.

Avoids a stupid gcc warning on arm:

src/udev/udevadm-monitor.c: In function ‘print_device’:
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=]
         printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
                ^

src/basic/formats-util.h

index ce516b117dfc027845c6ace62c9f5b1994367de3..9b4e8e98faacf301a125a092a2070861c75e0391 100644 (file)
@@ -49,7 +49,7 @@
 #if SIZEOF_TIME_T == 8
 #  define PRI_TIME PRIi64
 #elif SIZEOF_TIME_T == 4
-#  define PRI_TIME PRIu32
+#  define PRI_TIME "li"
 #else
 #  error Unknown time_t size
 #endif