[m-rev.] diff: determinism warnings in io.m

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jan 12 15:39:06 AEDT 2004


library/io.m:
	Suppress determinism warnings for two procedures.

Zoltan.

Index: io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.315
diff -u -b -r1.315 io.m
--- io.m	2 Dec 2003 10:02:05 -0000	1.315
+++ io.m	10 Jan 2004 06:46:39 -0000
@@ -2772,12 +2772,18 @@
 		Result = error(FileTypeError)
 	).
 
-:- pred have_dotnet_exec_permission(io__res, io__state, io__state).
-:- mode have_dotnet_exec_permission(out, di, uo) is det.
+:- pred have_dotnet_exec_permission(io__res::out, io__state::di, io__state::uo)
+	is det.
 
-have_dotnet_exec_permission(_, !IO) :-
-	error(
-	"io.have_dotnet_exec_permission invoked for non-.NET CLI backend").
+have_dotnet_exec_permission(Res, !IO) :-
+	% avoid determinism warnings
+	( semidet_succeed ->
+		error("io.have_dotnet_exec_permission invoked " ++
+			"for non-.NET CLI backend")
+	;
+		% never reached
+		Res = ok
+	).
 
 :- pragma foreign_proc("C#",
 	have_dotnet_exec_permission(Result::out, _IO0::di, _IO::uo),
@@ -2800,9 +2806,15 @@
 :- pred check_directory_accessibility_dotnet(string::in, int::in, int::in,
 		io__res::out, io__state::di, io__state::uo) is det.
 
-check_directory_accessibility_dotnet(_, _, _, _, _, _) :-
-	error(
-"io.check_directory_accessibility_dotnet called for non-.NET CLI backend").
+check_directory_accessibility_dotnet(_, _, _, Res, !IO) :-
+	% avoid determinism warnings
+	( semidet_succeed ->
+		error("io.check_directory_accessibility_dotnet called " ++
+			"for non-.NET CLI backend")
+	;
+		% never reached
+		Res = ok
+	).
 
 :- pragma foreign_proc("C#",
 	check_directory_accessibility_dotnet(FileName::in, CheckRead::in,
--------------------------------------------------------------------------
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