aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/diagnostic.c17
-rw-r--r--gcc/diagnostic.h1
5 files changed, 26 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f17bd5a..f9f9c961 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2000-08-24 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * 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.
+
2000-08-23 Alexandre Oliva <aoliva@redhat.com>
* dependence.c: Replace `[][]' with `[][MAX_SUBSCRIPTS]'.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c78ff70..7c9c887 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-24 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * error.c (print_instantiation_context): Don't forget to flush the
+ buffer.
+
2000-08-23 Jason Merrill <jason@redhat.com>
* typeck.c (build_ptrmemfunc): Save the input pmf.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 4329de5..52612a7 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2594,4 +2594,5 @@ print_instantiation_context ()
{
print_instantiation_partial_context
(diagnostic_buffer, current_instantiation (), input_filename, lineno);
+ flush_diagnostic_buffer ();
}
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);
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 196f3f7..39f650e 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -168,6 +168,7 @@ void initialize_diagnostics PARAMS ((void));
void reshape_diagnostic_buffer PARAMS ((void));
void default_initialize_buffer PARAMS ((output_buffer *));
void init_output_buffer PARAMS ((output_buffer *, const char *, int));
+void flush_diagnostic_buffer PARAMS ((void));
void output_clear PARAMS ((output_buffer *));
const char *output_get_prefix PARAMS ((const output_buffer *));
void output_set_prefix PARAMS ((output_buffer *, const char *));