[m-rev.] private_builtin.m improvements & purity warning bugfix

Simon Taylor stayl at cs.mu.OZ.AU
Thu Dec 13 21:10:59 AEDT 2001


On 13-Dec-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> compiler/purity.m:
> 	Fix a bug where it was reporting spurious warnings about
> 	"predicate declared `impure' but actually `pure'"
> 	for predicates defined with both Mercury code and
> 	`pragma foreign_proc' declarations.
> 	If the user declares `pragma foreign_proc' code to be
> 	impure, then the compiler should always respect that.

This should probably be a separate change.
There should also be a test case.

> Index: library/private_builtin.m
> ===================================================================
> +	% XXX Why isn't this marked as `impure'?
> +:- pred free_heap(_T).
> +:- mode free_heap(di) is det.

It should be.

> +free_heap(_::di) :-
> +	error("private_builtin__free_heap/1").

s/error/sorry/

> +:- pragma foreign_proc("MC++", free_heap(_Val::di),
> +	[will_not_call_mercury, thread_safe], "
> +	mercury::runtime::Errors::SORRY(""foreign code for free_heap/1"");
> +").

It's probably better to just remove this.

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list