This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 21/26] -Wpointer-sign: dwarf2read.c.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 12 Apr 2013 00:01:30 +0100
- Subject: [PATCH 21/26] -Wpointer-sign: dwarf2read.c.
- References: <20130411225847 dot 16791 dot 29283 dot stgit at brno dot lan>
This fixes the remaining issues necessary to make the DWARF reader
-Wpointer-sign clean. The 'filename' bit should be obvious.
'constant_pool' holds the contents of an obstack, which are 'char *'.
gdb_byte would work too, but it'd need more casts elsewhere, so I just
chose the minimal approach. Any way would be fine with me.
gdb/
2013-04-11 Pedro Alves <palves@redhat.com>
* dwarf2read.c (dwarf2_get_dwz_file): Add cast to const char *.
(read_index_from_section): Add cast to 'char *'.
---
gdb/dwarf2read.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 25dcfc9..3ed00cc 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2093,7 +2093,7 @@ dwarf2_get_dwz_file (void)
bfd_errmsg (bfd_get_error ()));
cleanup = make_cleanup (xfree, data);
- filename = data;
+ filename = (const char *) data;
if (!IS_ABSOLUTE_PATH (filename))
{
char *abs = gdb_realpath (dwarf2_per_objfile->objfile->name);
@@ -2754,7 +2754,7 @@ to use the section anyway."),
/ (2 * sizeof (offset_type)));
++i;
- map->constant_pool = addr + MAYBE_SWAP (metadata[i]);
+ map->constant_pool = (char *) (addr + MAYBE_SWAP (metadata[i]));
return 1;
}