+2000-08-22 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * diagnostic.h (report_problematic_module): Declare.
+ * diagnostic.c (report_problematic_module): New function.
+ (report_error_function): Tweak.
+
Tue Aug 22 02:31:26 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stmt.c (expand_goto_internal, fixup_gotos): Only check
report_error_function (file)
const char *file ATTRIBUTE_UNUSED;
{
- struct file_stack *p;
-
- if (output_needs_newline (diagnostic_buffer))
- {
- verbatim ("\n");
- output_needs_newline (diagnostic_buffer) = 0;
- }
-
- if (input_file_stack && input_file_stack->next != 0
- && error_function_changed ())
- {
- for (p = input_file_stack->next; p; p = p->next)
- if (p == input_file_stack->next)
- verbatim ("In file included from %s:%d", p->name, p->line);
- else
- verbatim (",\n from %s:%d", p->name, p->line);
- verbatim (":\n");
- record_last_error_function ();
- }
-
+ report_problematic_module (diagnostic_buffer);
(*print_error_function) (input_filename);
}
diagnostic_finalizer (dc) = lang_diagnostic_finalizer;
}
+void
+report_problematic_module (buffer)
+ output_buffer *buffer;
+{
+ struct file_stack *p;
+
+ if (output_needs_newline (buffer))
+ {
+ output_verbatim (buffer, "\n");
+ output_needs_newline (buffer) = 0;
+ }
+
+ if (input_file_stack && input_file_stack->next != 0
+ && error_function_changed ())
+ {
+ for (p = input_file_stack->next; p; p = p->next)
+ if (p == input_file_stack->next)
+ output_verbatim
+ (buffer, "In file included from %s:%d", p->name, p->line);
+ else
+ output_verbatim
+ (buffer, ",\n from %s:%d", p->name, p->line);
+ output_verbatim (buffer, ":\n");
+ record_last_error_function ();
+ }
+}
+
static void
default_diagnostic_starter (buffer, dc)
output_buffer *buffer;