Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] Fix sim build failure
@ 2021-04-23  1:51 Tom Tromey
  2021-04-23  1:56 ` Simon Marchi via Gdb-patches
  2021-04-23  2:16 ` Mike Frysinger via Gdb-patches
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2021-04-23  1:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

On x86-64 Fedora 32, the sim was failing to build.
sim_events_schedule was passing a 'dummy' argument to
sim_events_schedule_vtracef, which caused an error because the format
parameter was NULL.  However, removing this dummy argument caused an
error because too few arguments were being passed -- catch 22.

This patch fixes the build problem by using sim_events_schedule_tracef
instead.

sim/common/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* sim-events.c (sim_events_schedule): Use
	sim_events_schedule_tracef.
---
 sim/common/ChangeLog    | 5 +++++
 sim/common/sim-events.c | 5 +----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sim/common/sim-events.c b/sim/common/sim-events.c
index 207c8674d16..60e4c55a874 100644
--- a/sim/common/sim-events.c
+++ b/sim/common/sim-events.c
@@ -469,10 +469,7 @@ sim_events_schedule (SIM_DESC sd,
 		     sim_event_handler *handler,
 		     void *data)
 {
-  va_list dummy;
-  memset (&dummy, 0, sizeof dummy);
-  return sim_events_schedule_vtracef (sd, delta_time, handler, data,
-				      NULL, dummy);
+  return sim_events_schedule_tracef (sd, delta_time, handler, data, NULL);
 }
 #endif
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pushed] Fix sim build failure
  2021-04-23  1:51 [pushed] Fix sim build failure Tom Tromey
@ 2021-04-23  1:56 ` Simon Marchi via Gdb-patches
  2021-04-23  2:16 ` Mike Frysinger via Gdb-patches
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-04-23  1:56 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches



On 2021-04-22 9:51 p.m., Tom Tromey wrote:
> On x86-64 Fedora 32, the sim was failing to build.
> sim_events_schedule was passing a 'dummy' argument to
> sim_events_schedule_vtracef, which caused an error because the format
> parameter was NULL.  However, removing this dummy argument caused an
> error because too few arguments were being passed -- catch 22.
> 
> This patch fixes the build problem by using sim_events_schedule_tracef
> instead.
> 
> sim/common/ChangeLog
> 2021-04-22  Tom Tromey  <tom@tromey.com>
> 
> 	* sim-events.c (sim_events_schedule): Use
> 	sim_events_schedule_tracef.
> ---
>  sim/common/ChangeLog    | 5 +++++
>  sim/common/sim-events.c | 5 +----
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/sim/common/sim-events.c b/sim/common/sim-events.c
> index 207c8674d16..60e4c55a874 100644
> --- a/sim/common/sim-events.c
> +++ b/sim/common/sim-events.c
> @@ -469,10 +469,7 @@ sim_events_schedule (SIM_DESC sd,
>  		     sim_event_handler *handler,
>  		     void *data)
>  {
> -  va_list dummy;
> -  memset (&dummy, 0, sizeof dummy);
> -  return sim_events_schedule_vtracef (sd, delta_time, handler, data,
> -				      NULL, dummy);
> +  return sim_events_schedule_tracef (sd, delta_time, handler, data, NULL);
>  }
>  #endif
>  
> 

Ah, good catch.  Clang doesn't give this warning, and I didn't think of
building my patch with gcc, so I missed it.  Using the tracef variant
looks better anyway.

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pushed] Fix sim build failure
  2021-04-23  1:51 [pushed] Fix sim build failure Tom Tromey
  2021-04-23  1:56 ` Simon Marchi via Gdb-patches
@ 2021-04-23  2:16 ` Mike Frysinger via Gdb-patches
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger via Gdb-patches @ 2021-04-23  2:16 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 22 Apr 2021 19:51, Tom Tromey wrote:
> On x86-64 Fedora 32, the sim was failing to build.
> sim_events_schedule was passing a 'dummy' argument to
> sim_events_schedule_vtracef, which caused an error because the format
> parameter was NULL.  However, removing this dummy argument caused an
> error because too few arguments were being passed -- catch 22.
> 
> This patch fixes the build problem by using sim_events_schedule_tracef
> instead.

thx!
-mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-23  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23  1:51 [pushed] Fix sim build failure Tom Tromey
2021-04-23  1:56 ` Simon Marchi via Gdb-patches
2021-04-23  2:16 ` Mike Frysinger via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox