aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@codesourcery.com>2000-08-24 08:30:02 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2000-08-24 08:30:02 +0000
commit2ab99c469c493c52c4977df10a2fbe2cd8ad82d9 (patch)
tree121cbb1202f3c2a0bf8cddde99e1cf439d814256 /gcc/diagnostic.c
parent1ff5e2eb01866adccbd9296d0cb9edcdd5fea39b (diff)
downloadgcc-2ab99c469c493c52c4977df10a2fbe2cd8ad82d9.zip
gcc-2ab99c469c493c52c4977df10a2fbe2cd8ad82d9.tar.gz
gcc-2ab99c469c493c52c4977df10a2fbe2cd8ad82d9.tar.bz2
diagnostic.c (finish_diagnostic): Define.
* diagnostic.c (finish_diagnostic): Define. (output_do_printf): Use wrap_text instead of output_add_string. (default_print_error_function): Avoid embedded '\n'. * diagnostic.h (flush_diagnostic_buffer): Declare. cp/ * error.c (print_instantiation_context): Don't forget to flush the buffer. From-SVN: r35939
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index b343357..075f439 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -362,6 +362,13 @@ output_finish (buffer)
return (const char *) obstack_finish (&buffer->obstack);
}
+void
+flush_diagnostic_buffer ()
+{
+ output_to_stream (diagnostic_buffer, stderr);
+ fflush (stderr);
+}
+
/* Return the amount of characters BUFFER can accept to
make a full line. */
@@ -823,7 +830,7 @@ output_do_printf (buffer, msgid)
char *message = vbuild_message_string (msgid,
output_buffer_format_args (buffer));
- output_add_string (buffer, message);
+ wrap_text (buffer, message, message + strlen (message));
free (message);
}
@@ -1214,21 +1221,19 @@ default_print_error_function (file)
output_set_prefix (diagnostic_buffer, prefix);
if (current_function_decl == NULL)
- {
output_add_string (diagnostic_buffer, "At top level:");
- output_add_newline (diagnostic_buffer);
- }
else
{
if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
output_printf
- (diagnostic_buffer, "In method `%s':\n",
+ (diagnostic_buffer, "In method `%s':",
(*decl_printable_name) (current_function_decl, 2));
else
output_printf
- (diagnostic_buffer, "In function `%s':\n",
+ (diagnostic_buffer, "In function `%s':",
(*decl_printable_name) (current_function_decl, 2));
}
+ output_add_newline (diagnostic_buffer);
record_last_error_function ();
output_to_stream (diagnostic_buffer, stderr);