[m-dev.] for review: respect halt_at_warn for warn_unused_interfaces
Peter Ross
petdr at cs.mu.OZ.AU
Thu Jan 13 00:25:53 AEDT 2000
Hi,
DJ can you review this.
I will check this in on the 0.9.x branch as well.
===================================================================
Estimated hours taken: 0.5
The option, --warn-interface-imports, wasn't respecting the
--halt-at-warn option.
compiler/module_qual.m:
If --halt-at-warn turned on, make sure the compiler exits with a
non-zero exit status.
browser/collect_lib.m:
Remove unused interface imports.
Index: browser/collect_lib.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/browser/collect_lib.m,v
retrieving revision 1.2
diff -u -r1.2 collect_lib.m
--- browser/collect_lib.m 1999/11/03 14:41:43 1.2
+++ browser/collect_lib.m 2000/01/12 07:07:04
@@ -48,7 +48,6 @@
:- module collect_lib.
:- interface.
-:- import_module io, char, dl.
:- pred dummy_pred_to_avoid_warning_about_nothing_exported is det.
Index: compiler/module_qual.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/module_qual.m,v
retrieving revision 1.52
diff -u -r1.52 module_qual.m
--- compiler/module_qual.m 1999/11/11 23:12:00 1.52
+++ compiler/module_qual.m 2000/01/12 06:00:53
@@ -1305,6 +1305,7 @@
maybe_warn_unused_interface_imports(ModuleName, UnusedImports) -->
globals__io_lookup_bool_option(warn_interface_imports, Warn),
+ globals__io_lookup_bool_option(halt_at_warn, HaltAtWarn),
(
{ UnusedImports = []
; Warn = no
@@ -1335,7 +1336,14 @@
IsOrAre, " not\n"
]),
prog_out__write_context(Context),
- io__write_string(" used in the interface.\n")
+ io__write_string(" used in the interface.\n"),
+ (
+ { HaltAtWarn = yes }
+ ->
+ io__set_exit_status(1)
+ ;
+ []
+ )
).
:- pred is_or_are(list(T)::in, string::out) is det.
----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
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