aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2008-06-20 03:46:09 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2008-06-20 03:46:09 +0000
commite1e4cdc42c8b28235ab637dc5df2b4ef159c5b98 (patch)
treea9a495581b5ae5ebeabcad170ec8ae93f77566c2 /gcc/objc
parent54e998b2f10c2f2f4fcbf9f40ebcb926ac125d33 (diff)
downloadgcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.zip
gcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.tar.gz
gcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.tar.bz2
collect2.c (main, [...]): Fix for -Wc++-compat.
* collect2.c (main, add_to_list): Fix for -Wc++-compat. * gcc.c (translate_options, init_spec, store_arg, read_specs, add_to_obstack, file_at_path, find_a_file, execute, add_preprocessor_option, add_assembler_option, add_linker_option, process_command, insert_wrapper, do_option_spec, do_self_spec, spec_path, do_spec_1, is_directory, main, used_arg, getenv_spec_function): Likewise. * tlink.c (symbol_hash_lookup, file_hash_lookup, demangled_hash_lookup, symbol_push, file_push, frob_extension): Likewise. java: * class.c (ident_subst, mangled_classname, unmangle_classname, gen_indirect_dispatch_tables, add_method_1, build_fieldref_cache_entry, make_local_function_alias, layout_class, java_treetreehash_find, java_treetreehash_new, split_qualified_name): Fix for -Wc++-compat. * constants.c (set_constant_entry, cpool_for_class): Likewise. * decl.c (make_binding_level, java_dup_lang_specific_decl, start_java_method): Likewise. * except.c (prepare_eh_table_type): Likewise. * expr.c (type_assertion_hash, note_instructions): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC, MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * jcf-io.c (jcf_filbuf_from_stdio, opendir_in_zip, find_class): Likewise. * jcf-parse.c (reverse, java_read_sourcefilenames, annotation_grow, rewrite_reflection_indexes, java_parse_file, process_zip_dir): Likewise. * jcf-path.c (add_entry, add_path, jcf_path_init, jcf_path_extdirs_arg): Likewise. * jcf-reader.c (jcf_parse_constant_pool): Likewise. * jvgenmain.c (do_mangle_classname): Likewise. * lang.c (put_decl_string): Likewise. * verify-impl.c (make_state_copy, make_state, add_new_state): Likewise. objc: * objc-act.c (setup_string_decl, objc_build_string_object, hash_interface, eq_interface, objc_begin_try_stmt, encode_method_prototype, build_ivar_list_initializer, objc_build_encode_expr): Fix for -Wc++-compat. From-SVN: r136980
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog7
-rw-r--r--gcc/objc/objc-act.c18
2 files changed, 16 insertions, 9 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 62fb91d..f5869b3 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * objc-act.c (setup_string_decl, objc_build_string_object,
+ hash_interface, eq_interface, objc_begin_try_stmt,
+ encode_method_prototype, build_ivar_list_initializer,
+ objc_build_encode_expr): Fix for -Wc++-compat.
+
2008-05-12 Tomas Bily <tbily@suse.cz>
* objc-act.c (objc_generate_write_barrier, objc_finish_message_expr):
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index b19821c..4aef9a0 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1500,7 +1500,7 @@ setup_string_decl (void)
/* %s in format will provide room for terminating null */
length = strlen (STRING_OBJECT_GLOBAL_FORMAT)
+ strlen (constant_string_class_name);
- name = xmalloc (length);
+ name = XNEWVEC (char, length);
sprintf (name, STRING_OBJECT_GLOBAL_FORMAT,
constant_string_class_name);
constant_string_global_id = get_identifier (name);
@@ -1929,12 +1929,12 @@ objc_build_string_object (tree string)
/* Perhaps we already constructed a constant string just like this one? */
key.literal = string;
loc = htab_find_slot (string_htab, &key, INSERT);
- desc = *loc;
+ desc = (struct string_descriptor *) *loc;
if (!desc)
{
tree var;
- *loc = desc = ggc_alloc (sizeof (*desc));
+ *loc = desc = GGC_NEW (struct string_descriptor);
desc->literal = string;
/* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */
@@ -3290,14 +3290,14 @@ static GTY ((param_is (struct interface_tuple))) htab_t interface_htab;
static hashval_t
hash_interface (const void *p)
{
- const struct interface_tuple *d = p;
+ const struct interface_tuple *d = (const struct interface_tuple *) p;
return IDENTIFIER_HASH_VALUE (d->id);
}
static int
eq_interface (const void *p1, const void *p2)
{
- const struct interface_tuple *d = p1;
+ const struct interface_tuple *d = (const struct interface_tuple *) p1;
return d->id == p2;
}
@@ -3751,7 +3751,7 @@ next_sjlj_build_try_catch_finally (void)
void
objc_begin_try_stmt (location_t try_locus, tree body)
{
- struct objc_try_context *c = xcalloc (1, sizeof (*c));
+ struct objc_try_context *c = XCNEW (struct objc_try_context);
c->outer = cur_try_context;
c->try_body = body;
c->try_locus = try_locus;
@@ -4348,7 +4348,7 @@ encode_method_prototype (tree method_decl)
finish_encoding:
obstack_1grow (&util_obstack, '\0');
- result = get_identifier (obstack_finish (&util_obstack));
+ result = get_identifier (XOBFINISH (&util_obstack, char *));
obstack_free (&util_obstack, util_firstobj);
return result;
}
@@ -5160,7 +5160,7 @@ build_ivar_list_initializer (tree type, tree field_decl)
ivar
= tree_cons
(NULL_TREE,
- add_objc_string (get_identifier (obstack_finish (&util_obstack)),
+ add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
meth_var_types),
ivar);
obstack_free (&util_obstack, util_firstobj);
@@ -6690,7 +6690,7 @@ objc_build_encode_expr (tree type)
encode_type (type, obstack_object_size (&util_obstack),
OBJC_ENCODE_INLINE_DEFS);
obstack_1grow (&util_obstack, 0); /* null terminate string */
- string = obstack_finish (&util_obstack);
+ string = XOBFINISH (&util_obstack, const char *);
/* Synthesize a string that represents the encoded struct/union. */
result = my_build_string (strlen (string) + 1, string);