diff options
author | Alan Modra <amodra@gmail.com> | 2015-11-09 14:47:53 +1030 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2015-11-09 14:47:53 +1030 |
commit | c240b3e0de184a2bbb4f78e86126bee4748ab147 (patch) | |
tree | 40d04b5ff75eb1362564309965f342bdd9391702 /gcc/gensupport.c | |
parent | d4c8d5ede1f35643163942af46bcb51d3c03c8d7 (diff) | |
download | gcc-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/gensupport.c')
-rw-r--r-- | gcc/gensupport.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 0480e17..484ead2 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -2253,7 +2253,7 @@ htab_eq_string (const void *s1, const void *s2) and a permanent heap copy of STR is created. */ static void -add_mnemonic_string (htab_t mnemonic_htab, const char *str, int len) +add_mnemonic_string (htab_t mnemonic_htab, const char *str, size_t len) { char *new_str; void **slot; @@ -2306,7 +2306,7 @@ gen_mnemonic_setattr (htab_t mnemonic_htab, rtx insn) for (i = 0; *cp; ) { const char *ep, *sp; - int size = 0; + size_t size = 0; while (ISSPACE (*cp)) cp++; @@ -2333,8 +2333,7 @@ gen_mnemonic_setattr (htab_t mnemonic_htab, rtx insn) { /* Don't set a value if there are more than one instruction in the string. */ - obstack_next_free (&string_obstack) = - obstack_next_free (&string_obstack) - size; + obstack_blank_fast (&string_obstack, -size); size = 0; cp = sp; @@ -2346,7 +2345,7 @@ gen_mnemonic_setattr (htab_t mnemonic_htab, rtx insn) obstack_1grow (&string_obstack, '*'); else add_mnemonic_string (mnemonic_htab, - obstack_next_free (&string_obstack) - size, + (char *) obstack_next_free (&string_obstack) - size, size); i++; } |