aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-10-13 19:40:50 +0100
committerPedro Alves <palves@redhat.com>2015-10-13 19:40:50 +0100
commitaa5c10ce9b1bd04a7f4a619d5e956c977fcd60d3 (patch)
treed175920ee6783ddef83d4322a7e8fc5f964097c5 /gdb/ada-lang.c
parent4666fec3b414c7880e9629f3c9b0a5b584235c6d (diff)
downloadgdb-aa5c10ce9b1bd04a7f4a619d5e956c977fcd60d3.zip
gdb-aa5c10ce9b1bd04a7f4a619d5e956c977fcd60d3.tar.gz
gdb-aa5c10ce9b1bd04a7f4a619d5e956c977fcd60d3.tar.bz2
ada-lang.c: malloc/alloca casts for C++
gdb/ChangeLog: 2015-10-13 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_value_primitive_packed_val): Add casts to malloc and alloca calls.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 97f0c49..6d1998a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2550,7 +2550,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
we do, is unpack the data into a byte-aligned buffer, and then
use that buffer as our object's value for resolving the type. */
staging_len = (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
- staging = malloc (staging_len);
+ staging = (gdb_byte *) malloc (staging_len);
make_cleanup (xfree, staging);
ada_unpack_from_contents (src, bit_offset, bit_size,
@@ -2581,7 +2581,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
v = value_at (type, value_address (obj) + offset);
- src = alloca (src_len);
+ src = (gdb_byte *) alloca (src_len);
read_memory (value_address (v), src, src_len);
}
else