diff src/error.cc @ 3491:2c7524ffdbf5

[project @ 2000-01-28 22:44:13 by jwe]
author jwe
date Fri, 28 Jan 2000 22:44:14 +0000
parents fc5eac74640d
children d14c483b3c12
line wrap: on
line diff
--- a/src/error.cc
+++ b/src/error.cc
@@ -57,6 +57,29 @@
 // The message buffer
 ostrstream *error_message_buffer = 0;
 
+// Warning messages are never buffered.
+// XXX FIXME XXX -- we should provide another way to turn them off...
+
+static void
+vwarning (const char *name, const char *fmt, va_list args)
+{
+  flush_octave_stdout ();
+
+  ostrstream output_buf;
+
+  if (name)
+    {
+      octave_diary << name << ": ";
+      cerr << name << ": ";
+    }
+
+  octave_diary.vform (fmt, args);
+  cerr.vform (fmt, args);
+
+  octave_diary << endl;
+  cerr << endl;
+}
+
 static void
 verror (const char *name, const char *fmt, va_list args)
 {
@@ -175,7 +198,7 @@
   va_list args;
   va_start (args, fmt);
   warning_state = 1;
-  verror ("warning", fmt, args);
+  vwarning ("warning", fmt, args);
   va_end (args);
 }