aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-09 04:30:26 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-09 04:30:26 +0000
commitc59881a73d39952a7e596f14e43df024304f2167 (patch)
treec1be301479b11951aef532b613c5b1aa57cc63c6 /libiberty
parentd843131446fa32915ceb12049d3606062307a8fe (diff)
Silence obstack.c -Wc++compat warning
* obstack.c (_obstack_newchunk): Silence -Wc++compat warning. (_obstack_begin_worker): Likewise. Move assignment to h->chunk after alloc failure check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229989 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/obstack.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 3bd9a9650df..7821e70e57a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,11 @@
2015-11-09 Alan Modra <amodra@gmail.com>
+ * obstack.c (_obstack_newchunk): Silence -Wc++compat warning.
+ (_obstack_begin_worker): Likewise. Move assignment to h->chunk
+ after alloc failure check.
+
+2015-11-09 Alan Modra <amodra@gmail.com>
+
PR gdb/17133
* obstack.c (__alignof__): Expand alignof_type from alignof.h.
(obstack_exit_failure): Don't use exitfail.h.
diff --git a/libiberty/obstack.c b/libiberty/obstack.c
index 9f34da1164b..6d8d67261dd 100644
--- a/libiberty/obstack.c
+++ b/libiberty/obstack.c
@@ -138,9 +138,10 @@ _obstack_begin_worker (struct obstack *h,
h->chunk_size = size;
h->alignment_mask = alignment - 1;
- chunk = h->chunk = call_chunkfun (h, h->chunk_size);
+ chunk = (struct _obstack_chunk *) call_chunkfun (h, h->chunk_size);
if (!chunk)
(*obstack_alloc_failed_handler) ();
+ h->chunk = chunk;
h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
alignment - 1);
h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size;
@@ -202,7 +203,7 @@ _obstack_newchunk (struct obstack *h, _OBSTACK_SIZE_T length)
/* Allocate and initialize the new chunk. */
if (obj_size <= sum1 && sum1 <= sum2)
- new_chunk = call_chunkfun (h, new_size);
+ new_chunk = (struct _obstack_chunk *) call_chunkfun (h, new_size);
if (!new_chunk)
(*obstack_alloc_failed_handler)();
h->chunk = new_chunk;