summaryrefslogtreecommitdiff
path: root/tools/dbus-print-message.c
diff options
context:
space:
mode:
authorColin Walters <walters@lightbox.localdomain>2010-03-22 11:50:24 -0400
committerColin Walters <walters@verbum.org>2010-03-22 13:58:56 -0400
commitc93d3ec2ff13f31291c56f6d5d4f7a77ecdb5ea7 (patch)
tree6e9e3b9c07f54b0b4e947ea1ed67535b587b3c1f /tools/dbus-print-message.c
parent03bb3ce656e9b14fe643572dd0d39f82e955f1f5 (diff)
downloaddbus-c93d3ec2ff13f31291c56f6d5d4f7a77ecdb5ea7.tar.gz
Add DBUS_INT64_MODIFIER define, turn on -Wformat
https://bugs.freedesktop.org/show_bug.cgi?id=19195 We were previously using -Wno-format because we didn't have a #define for DBUS_INT64_MODIFIER, which was really lame because it easily hid problems. For now, just define it if we're on glibc; this is obviously not strictly correct but it's safe, because the formatting is only used in DBUS_VERBOSE mode, and in tools/dbus-monitor. Ideally we get the the glib code relicensed.
Diffstat (limited to 'tools/dbus-print-message.c')
-rw-r--r--tools/dbus-print-message.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c
index 8a8e351d..cac40410 100644
--- a/tools/dbus-print-message.c
+++ b/tools/dbus-print-message.c
@@ -22,6 +22,7 @@
#include "dbus-print-message.h"
#include <stdlib.h>
+#include "config.h"
static const char*
type_to_name (int message_type)
@@ -225,7 +226,9 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
{
dbus_int64_t val;
dbus_message_iter_get_basic (iter, &val);
- printf ("int64 %lld\n", val);
+#ifdef DBUS_INT64_PRINTF_MODIFIER
+ printf ("int64 %" DBUS_INT64_PRINTF_MODIFIER "d\n", val);
+#endif
break;
}
@@ -233,7 +236,9 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
{
dbus_uint64_t val;
dbus_message_iter_get_basic (iter, &val);
- printf ("uint64 %llu\n", val);
+#ifdef DBUS_INT64_PRINTF_MODIFIER
+ printf ("uint64 %" DBUS_INT64_PRINTF_MODIFIER "u\n", val);
+#endif
break;
}