diff options
author | Tom Tromey <tromey@redhat.com> | 2014-06-13 13:08:23 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-06-20 08:44:19 -0600 |
commit | 26f2dc3065ea8621b898fe5b98ef19afbf02aaf7 (patch) | |
tree | 4cd816f400c0d0691cd7f7da3c770cc9320d9662 /gdb/dwarf2read.c | |
parent | 698b3e08336ffac76d45d9ddb6a85ae166098140 (diff) | |
download | gdb-26f2dc3065ea8621b898fe5b98ef19afbf02aaf7.zip gdb-26f2dc3065ea8621b898fe5b98ef19afbf02aaf7.tar.gz gdb-26f2dc3065ea8621b898fe5b98ef19afbf02aaf7.tar.bz2 |
make obstack object allocators more type-safe
This changes OBSTACK_ZALLOC and OBSTACK_CALLOC to cast their value to
the correct type. This is more type-safe and also is more in line
with the other object-allocation macros in libiberty.h.
Making this change revealed one trivial error in dwarf2read.c.
On the whole that seems pretty good to me.
Tested by rebuilding.
2014-06-20 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dw2_get_real_path): Use correct type in
OBSTACK_CALLOC.
* gdb_obstack.h (OBSTACK_ZALLOC, OBSTACK_CALLOC): Cast result.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9a9f5aa..ba64256 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3297,7 +3297,7 @@ dw2_get_real_path (struct objfile *objfile, { if (qfn->real_names == NULL) qfn->real_names = OBSTACK_CALLOC (&objfile->objfile_obstack, - qfn->num_file_names, char *); + qfn->num_file_names, const char *); if (qfn->real_names[index] == NULL) qfn->real_names[index] = gdb_realpath (qfn->file_names[index]); |