aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-11-09 14:47:53 +1030
committerAlan Modra <amodra@gcc.gnu.org>2015-11-09 14:47:53 +1030
commitc240b3e0de184a2bbb4f78e86126bee4748ab147 (patch)
tree40d04b5ff75eb1362564309965f342bdd9391702 /gcc/objc
parentd4c8d5ede1f35643163942af46bcb51d3c03c8d7 (diff)
downloadgcc-c240b3e0de184a2bbb4f78e86126bee4748ab147.zip
gcc-c240b3e0de184a2bbb4f78e86126bee4748ab147.tar.gz
gcc-c240b3e0de184a2bbb4f78e86126bee4748ab147.tar.bz2
New obstack_next_free is not an lvalue
New obstack.h casts obstack_next_free to (void *), resulting in it being a non-lvalue, and warnings on pointer arithmetic. gcc/ * gensupport.c (add_mnemonic_string): Make len param a size_t. (gen_mnemonic_setattr): Make "size" var a size_t. Use obstack_blank_fast to shrink obstack. Cast obstack_next_free return value. gcc/objc/ * objc-encoding.c (encode_aggregate_within): Cast obstack_next_free return value. From-SVN: r229984
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog5
-rw-r--r--gcc/objc/objc-encoding.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 23721f6..57b5db4 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-09 Alan Modra <amodra@gmail.com>
+
+ * objc-encoding.c (encode_aggregate_within): Cast obstack_next_free
+ return value.
+
2015-10-29 Andrew MacLeod <amacleod@redhat.com>
* objc-lang.c: Reorder #include's and remove duplicates.
diff --git a/gcc/objc/objc-encoding.c b/gcc/objc/objc-encoding.c
index 4848021..9c577e9 100644
--- a/gcc/objc/objc-encoding.c
+++ b/gcc/objc/objc-encoding.c
@@ -495,13 +495,14 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
if (flag_next_runtime)
{
- if (ob_size > 0 && *(obstack_next_free (&util_obstack) - 1) == '^')
+ if (ob_size > 0
+ && *((char *) obstack_next_free (&util_obstack) - 1) == '^')
pointed_to = true;
if ((format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
&& (!pointed_to || ob_size - curtype == 1
|| (ob_size - curtype == 2
- && *(obstack_next_free (&util_obstack) - 2) == 'r')))
+ && *((char *) obstack_next_free (&util_obstack) - 2) == 'r')))
inline_contents = true;
}
else
@@ -512,9 +513,10 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
comment above applies: in that case we should avoid encoding
the names of instance variables.
*/
- char c1 = ob_size > 1 ? *(obstack_next_free (&util_obstack) - 2) : 0;
- char c0 = ob_size > 0 ? *(obstack_next_free (&util_obstack) - 1) : 0;
+ char c0, c1;
+ c1 = ob_size > 1 ? *((char *) obstack_next_free (&util_obstack) - 2) : 0;
+ c0 = ob_size > 0 ? *((char *) obstack_next_free (&util_obstack) - 1) : 0;
if (c0 == '^' || (c1 == '^' && c0 == 'r'))
pointed_to = true;