[m-dev.] diff: flush stdout when printing to stderr

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Aug 1 15:33:18 AEST 2000


library/exception.m:
	Before printing warning messages about missing exception events to
	stderr, flush stdout. Without this, the order of output is
	unpredictable, which means that regression tests can "fail"
	due to differences in flush orders (particular when exactly one
	of the .exp and .out files was generated on a machine with readline).

Zoltan.

cvs diff: Diffing .
Index: exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.26
diff -u -b -r1.26 exception.m
--- exception.m	2000/07/24 16:50:02	1.26
+++ exception.m	2000/08/01 05:23:25
@@ -912,9 +912,12 @@
 */
 
 #define WARNING(msg)							\\
+	do {								\\
+		fflush(stdout);						\\
 	fprintf(stderr, ""mdb: warning: %s\\n""				\\
 		""This may result in some exception events\\n""		\\
-		""being omitted from the trace.\\n"", (msg))
+			""being omitted from the trace.\\n"", (msg));	\\
+	} while (0)
 
 static Code *
 MR_trace_throw(Code *success_pointer, Word *det_stack_pointer,
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list