* objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl.
(objc_declare_class): Likewise.
(error_with_ivar): Likewise.
(start_class): Likewise.
(warn_with_method): Likewise.
java/
* expr.c (expand_java_field_op): Don't use xxx_with_decl
(expand_java_field_op): Likewise.
* class.c (layout_class_method): Likewise
(emit_register_classes): Likewise.
* decl.c (pushdecl): Likewise.
(poplevel): Likewise.
(force_poplevels): Likewise.
(give_name_to_locals): Likewise.
* check-init.c (check_for_initialization): Likewise.
From-SVN: r69780
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl.
+ (objc_declare_class): Likewise.
+ (error_with_ivar): Likewise.
+ (start_class): Likewise.
+ (warn_with_method): Likewise.
+
2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
Remove pedwarn_with_decl, warning_with_decl and error_with_decl
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * expr.c (expand_java_field_op): Don't use xxx_with_decl
+ (expand_java_field_op): Likewise.
+ * class.c (layout_class_method): Likewise
+ (emit_register_classes): Likewise.
+ * decl.c (pushdecl): Likewise.
+ (poplevel): Likewise.
+ (force_poplevels): Likewise.
+ (give_name_to_locals): Likewise.
+ * check-init.c (check_for_initialization): Likewise.
+
2003-07-24 Jason Merrill <jason@redhat.com>
* java-tree.h: Move boolean_type_node et al to the back end.
if (index >= 0 && ! ASSIGNED_P (before, index))
{
if (! is_finit_method)
- error_with_decl (decl, "final field '%s' may not have been initialized");
+ error ("%Hfinal field '%D' may not have been initialized",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
else if (is_finit_method)
DECL_FIELD_FINAL_IUD (decl) = 1;
if (METHOD_ABSTRACT (method))
{
if (! abstract_p)
- warning_with_decl (method,
- "abstract method in non-abstract class");
+ warning ("%Habstract method in non-abstract class",
+ &DECL_SOURCE_FILE (method));
if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
if (DECL_VINDEX (method_decl) == NULL_TREE
&& !CLASS_FROM_SOURCE_P (this_class))
- error_with_decl (method_decl,
- "non-static method '%s' overrides static method");
+ error ("%Hnon-static method '%D' overrides static method",
+ &DECL_SOURCE_LOCATION (method_decl), method_decl);
}
else if (! METHOD_FINAL (method_decl)
&& ! METHOD_PRIVATE (method_decl)
/* error_mark_node is 0 for a while during initialization! */
{
t = 0;
- error_with_decl (x, "`%s' used prior to declaration");
+ error ("%H'%D' used prior to declaration",
+ &DECL_SOURCE_LOCATION (x), x);
}
if (t != 0)
if (DECL_INITIAL (label) == 0)
{
- error_with_decl (label, "label `%s' used but not defined");
+ error ("%Hlabel '%D' used but not defined",
+ &DECL_SOURCE_LOCATION (label), label);
/* Avoid crashing later. */
define_label (input_location, DECL_NAME (label));
}
else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
- warning_with_decl (label, "label `%s' defined but not used");
+ warning ("%Hlabel '%D' defined but not used",
+ &DECL_SOURCE_LOCATION (label), label);
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
/* Put the labels into the "variables" of the
while (current_binding_level->start_pc > start_pc)
{
if (pedantic && current_binding_level->start_pc > start_pc)
- warning_with_decl (current_function_decl,
- "In %s: overlapped variable and exception ranges at %d",
- current_binding_level->start_pc);
+ warning (current_function_decl,
+ "%HIn %D: overlapped variable and exception ranges at %d",
+ &DECL_SOURCE_LOCATION (current_function_decl),
+ current_function_decl, current_binding_level->start_pc);
expand_end_bindings (getdecls (), 1, 0);
poplevel (1, 0, 0);
}
tree decl = build_decl (VAR_DECL, name, type);
if (end_pc > DECL_CODE_LENGTH (current_function_decl))
{
- warning_with_decl (decl,
- "bad PC range for debug info for local `%s'");
+ warning ("%Hbad PC range for debug info for local '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
end_pc = DECL_CODE_LENGTH (current_function_decl);
}
if (FIELD_FINAL (field_decl))
{
if (DECL_CONTEXT (field_decl) != current_class)
- error_with_decl (field_decl,
- "assignment to final field `%s' not in field's class");
+ error ("%Hassignment to final field '%D' not in field's class",
+ &DECL_SOURCE_LOCATION (field_decl), field_decl);
else if (FIELD_STATIC (field_decl))
{
if (!DECL_CLINIT_P (current_function_decl))
- warning_with_decl (field_decl,
- "assignment to final static field `%s' not in class initializer");
+ warning ("assignment to final static field `%s' not in "
+ "class initializer",
+ &DECL_SOURCE_LOCATION (field_decl), field_decl);
}
else
{
tree cfndecl_name = DECL_NAME (current_function_decl);
if (! DECL_CONSTRUCTOR_P (current_function_decl)
&& !ID_FINIT_P (cfndecl_name))
- warning_with_decl (field_decl, "assignment to final field `%s' not in constructor");
+ warning ("%Hassignment to final field '%D' not in constructor",
+ &DECL_SOURCE_LOCATION (field_decl), field_decl);
}
}
expand_assignment (field_ref, new_value, 0);
if (TREE_CODE (type) == RECORD_TYPE
&& TREE_STATIC_TEMPLATE (type)
&& type != constant_string_type)
- error_with_decl (decl, "`%s' cannot be statically allocated");
+ error ("%H'%D' cannot be statically allocated",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
/* Implement static typing. At this point, we know we have an interface. */
{
error ("`%s' redeclared as different kind of symbol",
IDENTIFIER_POINTER (ident));
- error_with_decl (decl, "previous declaration of `%s'");
+ error ("%Hprevious declaration of '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
if (! is_class_name (ident))
{
error ("`%s' redeclared as different kind of symbol",
IDENTIFIER_POINTER (class_name));
- error_with_decl (decl, "previous declaration of `%s'");
+ error ("%Hprevious declaration of '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
if (code == CLASS_IMPLEMENTATION_TYPE)