Avoid C# unused variable warnings in catch clauses.

library/io.file.m:
ssdb/ssdb.m:
    Omit unused variables in catch clauses.
This commit is contained in:
Peter Wang
2022-03-11 15:45:16 +11:00
parent 853d13153c
commit 5425965e16
2 changed files with 3 additions and 5 deletions

View File

@@ -1603,15 +1603,13 @@ get_temp_directory(Dir, !IO) :-
[will_not_call_mercury, promise_pure, tabled_for_io, thread_safe,
may_not_duplicate],
"
#pragma warning disable 162, 168, 169, 219, 1717
try {
Dir = System.IO.Path.GetTempPath();
OK = (Dir != null) ? 1 : 0;
} catch (System.Exception _) {
} catch (System.Exception) {
Dir = null;
OK = 0;
}
#pragma warning restore
").
system_temp_dir("", 0, !IO).

View File

@@ -506,14 +506,14 @@ public static class SigIntHandler implements sun.misc.SignalHandler {
try {
System.Console.TreatControlCAsInput = false;
}
catch (System.Exception e) {}
catch (System.Exception) {}
try {
System.Console.CancelKeyPress += new System.ConsoleCancelEventHandler(
ssdb.sigint_handler
);
}
catch (System.Exception e) {}
catch (System.Exception) {}
").
:- pragma foreign_proc("Java",