* [PATCH] Fix build failure due to compiler warning.
@ 2011-11-16 6:12 David Miller
2011-11-16 14:58 ` Tom Tromey
2011-11-23 14:42 ` Mark Kettenis
0 siblings, 2 replies; 4+ messages in thread
From: David Miller @ 2011-11-16 6:12 UTC (permalink / raw)
To: gdb-patches
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build failure due to compiler warning.
2011-11-16 6:12 [PATCH] Fix build failure due to compiler warning David Miller
@ 2011-11-16 14:58 ` Tom Tromey
2011-11-23 14:42 ` Mark Kettenis
1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-11-16 14:58 UTC (permalink / raw)
To: David Miller; +Cc: gdb-patches
>>>>> "David" == David Miller <davem@davemloft.net> writes:
David> Ok to commit?
David> 2011-11-15 David S. Miller <davem@davemloft.net>
David> * utils.c (report_command_stats): Cast delta_wall_time 'tv_sec' and
David> 'tv_usec' to long for printf since these fields have a type which
David> varies.
This is ok. Thanks.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build failure due to compiler warning.
2011-11-16 6:12 [PATCH] Fix build failure due to compiler warning David Miller
2011-11-16 14:58 ` Tom Tromey
@ 2011-11-23 14:42 ` Mark Kettenis
2011-11-23 21:43 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2011-11-23 14:42 UTC (permalink / raw)
To: davem; +Cc: gdb-patches
> Date: Wed, 16 Nov 2011 01:12:17 -0500 (EST)
> From: David Miller <davem@davemloft.net>
>
> 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?
Not sure if you already committed this, but "long int" sounds a bit
pedantic, so I'd prefer to see this with "long". But either way, this
is ok.
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix build failure due to compiler warning.
2011-11-23 14:42 ` Mark Kettenis
@ 2011-11-23 21:43 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-11-23 21:43 UTC (permalink / raw)
To: mark.kettenis; +Cc: gdb-patches
From: Mark Kettenis <mark.kettenis@xs4all.nl>
Date: Wed, 23 Nov 2011 15:41:33 +0100 (CET)
>> Date: Wed, 16 Nov 2011 01:12:17 -0500 (EST)
>> From: David Miller <davem@davemloft.net>
>>
>> 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?
>
> Not sure if you already committed this, but "long int" sounds a bit
> pedantic, so I'd prefer to see this with "long". But either way, this
> is ok.
I did commit this, and I did use "long" as is mentioned in both my
description above and the ChangeLog entry :-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-23 21:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-16 6:12 [PATCH] Fix build failure due to compiler warning David Miller
2011-11-16 14:58 ` Tom Tromey
2011-11-23 14:42 ` Mark Kettenis
2011-11-23 21:43 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox