This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix build failure due to compiler warning.
- From: David Miller <davem at davemloft dot net>
- To: gdb-patches at sourceware dot org
- Date: Wed, 16 Nov 2011 01:12:17 -0500 (EST)
- Subject: [PATCH] Fix build failure due to compiler warning.
On Sparc/Linux, __suseconds_t is not a type compatible with 'long' so
these printf statements trigger a warning and thus a build failure.
This mirrors the casting already being done for the same exact reason
in vprintf_unfiltered.
Ok to commit?
2011-11-15 David S. Miller <davem@davemloft.net>
* utils.c (report_command_stats): Cast delta_wall_time 'tv_sec' and
'tv_usec' to long for printf since these fields have a type which
varies.
diff --git a/gdb/utils.c b/gdb/utils.c
index 82a0f45..a1cf8fc 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -707,7 +707,8 @@ report_command_stats (void *arg)
? _("Startup time: %ld.%06ld (cpu), %ld.%06ld (wall)\n")
: _("Command execution time: %ld.%06ld (cpu), %ld.%06ld (wall)\n"),
cmd_time / 1000000, cmd_time % 1000000,
- delta_wall_time.tv_sec, delta_wall_time.tv_usec);
+ (long int) delta_wall_time.tv_sec,
+ (long int) delta_wall_time.tv_usec);
}
if (display_space)