[m-dev.] for review: cleanup of tabling

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Dec 31 15:31:03 AEDT 1999


On 28-Dec-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> runtime/mercury_wrapper.c:
> 	When debugging tabling, set stdout to be line buffered.

What's the rationale for that change?

> +++ runtime/mercury_wrapper.c	1999/12/25 08:17:25
> @@ -284,6 +284,12 @@
>  	process_args(argc, argv);
>  	process_environment_options();
>  
> +#ifdef	MR_TABLE_DEBUG
> +	if (MR_tabledebug) {
> +		setlinebuf(stdout);
> +	}
> +#endif

The setlinebuf() function is not part of ANSI/ISO C;
for portability, you should use the ANSI/ISO setvbuf() function instead.

It would be better to put that code next to the existing calls
to setvbuf(), so that all the changes to the buffering of stdout
are in the same place.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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