OSDN Git Service

* diagnostic.c (finish_diagnostic): Define.
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Aug 2000 08:30:02 +0000 (08:30 +0000)
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Aug 2000 08:30:02 +0000 (08:30 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35939 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/diagnostic.c
gcc/diagnostic.h

index f17bd5a..f9f9c96 100644 (file)
@@ -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]'.
index c78ff70..7c9c887 100644 (file)
@@ -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.
index 4329de5..52612a7 100644 (file)
@@ -2594,4 +2594,5 @@ print_instantiation_context ()
 {
   print_instantiation_partial_context
     (diagnostic_buffer, current_instantiation (), input_filename, lineno);
+  flush_diagnostic_buffer ();
 }
index b343357..075f439 100644 (file)
@@ -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);
index 196f3f7..39f650e 100644 (file)
@@ -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 *));