summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-22 06:54:54 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-22 06:54:54 +0000
commit5e3153b08ae4676c23fec9014b43fa9a8dba5d04 (patch)
tree58da251d2b0356355ede0569a531cdde142081d4 /gcc/diagnostic.c
parent9721a5c3cd2e7d3a3aea2ab2791a6f870346c043 (diff)
downloadgcc-5e3153b08ae4676c23fec9014b43fa9a8dba5d04.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 7124ecd58e3..35ca050c18f 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1243,26 +1243,7 @@ void
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);
}
@@ -1677,6 +1658,33 @@ set_diagnostic_context (dc, message, args_ptr, file, line, warn)
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;