From: Mike Frysinger Date: Tue, 30 Mar 2010 20:43:36 +0000 (+0000) Subject: sim: fix printf format warning about non-string literal X-Git-Tag: sid-snapshot-20100401~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d946c2884d66f64c4b671bbed16283bcae3c5667;p=platform%2Fupstream%2Fbinutils.git sim: fix printf format warning about non-string literal This is the normal "passing a buffer straight to printf makes GCC warn". While we know this particular case is fine, the trend in this source tree is to fix this anyways to avoid the warnings. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 9153cb5..3edb464b 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ 2010-03-30 Mike Frysinger + * sim-utils.c (sim_io_eprintf_cpu): Use %s with printf string. + * sim-hw.c (hw_option_handler): Likewise. + +2010-03-30 Mike Frysinger + * sim-watch.c (watchpoint_type_to_str): Add const to return. (interrupt_nr_to_str): Likewise. (default_interrupt_names): Add const to pointer type. diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c index d9868d3..7481492 100644 --- a/sim/common/sim-hw.c +++ b/sim/common/sim-hw.c @@ -257,7 +257,7 @@ hw_option_handler (struct sim_state *sd, sim_cpu *cpu, int opt, case OPTION_HW_DEVICE: { - hw_tree_parse (STATE_HW (sd)->tree, arg); + hw_tree_parse (STATE_HW (sd)->tree, "%s", arg); return SIM_RC_OK; } diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index fb84eb3..9f9104e 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -170,7 +170,7 @@ sim_io_eprintf_cpu (sim_cpu *cpu, const char *fmt, ...) va_list ap; va_start (ap, fmt); - sim_io_eprintf (sd, sim_cpu_msg_prefix (cpu)); + sim_io_eprintf (sd, "%s", sim_cpu_msg_prefix (cpu)); sim_io_evprintf (sd, fmt, ap); va_end (ap); }