summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-03-30 20:38:26 +0000
committerMike Frysinger <vapier@gentoo.org>2010-03-30 20:38:26 +0000
commitfb0cc53ef61e1f7302f886a07fef53a908a1795d (patch)
tree338f99a1cc4abd6544ccd232560e5a327831f7a7 /sim
parent739dfd28c359b1b0ef4a78092f990f86ca0e165b (diff)
downloadbinutils-gdb-fb0cc53ef61e1f7302f886a07fef53a908a1795d.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')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/sim-core.h2
-rw-r--r--sim/cris/ChangeLog3
-rw-r--r--sim/cris/devices.c2
-rw-r--r--sim/frv/ChangeLog4
-rw-r--r--sim/frv/devices.c2
-rw-r--r--sim/m32r/ChangeLog4
-rw-r--r--sim/m32r/devices.c2
8 files changed, 20 insertions, 4 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
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
new file mode 100644
index 00000000000..d7aadd0a13d
--- /dev/null
+++ b/sim/cris/ChangeLog
@@ -0,0 +1,3 @@
+2010-03-30 Mike Frysinger <vapier@gentoo.org>
+
+ * devices.c (device_error): Add const to message.
diff --git a/sim/cris/devices.c b/sim/cris/devices.c
index 7218c660a5c..50032a65c7e 100644
--- a/sim/cris/devices.c
+++ b/sim/cris/devices.c
@@ -34,7 +34,7 @@ struct _device { char dummy; } cris_devices;
void
device_error (device *me ATTRIBUTE_UNUSED,
- char *message ATTRIBUTE_UNUSED,
+ const char *message ATTRIBUTE_UNUSED,
...)
{
abort ();
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 0e703aeaeb7..b49321d2fd9 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-30 Mike Frysinger <vapier@gentoo.org>
+
+ * devices.c (device_error): Add const to message.
+
2010-02-12 Doug Evans <dje@sebabeach.org>
* decode.c, * decode.h: Regenerate.
diff --git a/sim/frv/devices.c b/sim/frv/devices.c
index 3c028c0677d..9b0819f87d0 100644
--- a/sim/frv/devices.c
+++ b/sim/frv/devices.c
@@ -93,4 +93,4 @@ device_io_write_buffer (device *me, const void *source, int space,
return nr_bytes;
}
-void device_error (device *me, char* message, ...) {}
+void device_error (device *me, const char *message, ...) {}
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index 9981230ec82..4c4ca6cbb92 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-30 Mike Frysinger <vapier@gentoo.org>
+
+ * devices.c (device_error): Add const to message.
+
2010-02-11 Doug Evans <dje@sebabeach.org>
* cpu.h, * cpu2.h, * cpux.h, * decode.c, * decode2.c, * decodex.c,
diff --git a/sim/m32r/devices.c b/sim/m32r/devices.c
index cc39d5d9d76..4442f1136db 100644
--- a/sim/m32r/devices.c
+++ b/sim/m32r/devices.c
@@ -102,6 +102,6 @@ device_io_write_buffer (device *me, const void *source, int space,
}
void
-device_error (device *me, char *message, ...)
+device_error (device *me, const char *message, ...)
{
}