[m-dev.] For review: warn rather than abort for MERCURY_OPTIONS not applicable to current grade

Warwick Harvey wharvey at cs.monash.edu.au
Fri Aug 7 17:07:44 AEST 1998


Fergus writes:
> We ought to have a single function called say MR_warning()
> for printing warning messages, something like this:
> 
> 	void
> 	MR_warning(const char *msg, ...)
> 	{
> 		va_list args;
> 
> 		fprintf(stderr, "Mercury runtime: ");
> 		va_start(args, msg);
> 		vfprintf(stderr, args);
> 		va_end(args);
> 		fprintf(stderr, "\n");
> 	}

This is different from fatal_error() in that fatal_error() only allows a 
string; no arguments.  Would it be useful to change fatal_error() to take 
extra arguments as well at the same time?

> However, currently we don't.  I'd be very happy if someone added one.

I'm adding it to runtime/mercury_misc.[ch], same place as fatal_error().  I 
assume this is OK?

> Regarding the actual warning messages in your change, it may be
> worth mentioning "MERCURY_OPTIONS" in the warning messages.

Done.

Warwick




More information about the developers mailing list