diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-03-30 20:38:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-30 20:38:26 +0000 |
commit | 35f63f9ca57cf5b4e6d1f275f0cab2205f7580cb (patch) | |
tree | 1ec3c915a4db9ae21880b9b419afd6030e778029 /sim/common | |
parent | d3dc1456c6891924ddad6e7c5e04a667a79910bc (diff) | |
download | gdb-35f63f9ca57cf5b4e6d1f275f0cab2205f7580cb.tar.gz |
sim: update device_error() prototype
The device_error() takes a printf style string, so update the prototype
accordingly. The message should be const and it should use an attribute.
This fixes gcc warnings like:
sim-core.c: In function 'sim_core_map_attach':
sim-core.c:200: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
sim-core.c:237: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
sim-core.c: In function 'sim_core_attach':
sim-core.c:304: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
sim-core.c:314: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
sim-core.c:335: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
sim-core.c:348: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | sim/common/sim-core.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 7c5e1b7c733..50418a74e9e 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ 2010-03-30 Mike Frysinger <vapier@gentoo.org> + * sim-core.h (device_error): Add const to message, and add printf + format attribute. + +2010-03-30 Mike Frysinger <vapier@gentoo.org> + * sim-profile.c (profile_print_addr_ranges): Wrap with the SIM_HAVE_ADDR_RANGE define. diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h index 3fac62727bf..696511c45c5 100644 --- a/sim/common/sim-core.h +++ b/sim/common/sim-core.h @@ -344,7 +344,7 @@ DECLARE_SIM_CORE_READ_N(misaligned,7,8) #if (WITH_DEVICES) /* TODO: create sim/common/device.h */ /* These are defined with each particular cpu. */ -void device_error (device *me, char* message, ...); +void device_error (device *me, const char *message, ...) __attribute__((format (printf, 2, 3))); int device_io_read_buffer(device *me, void *dest, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia); int device_io_write_buffer(device *me, const void *source, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia); #endif |