diff: options.m: fix bugs with --inhibit-warnings

Fergus Henderson fjh at cs.mu.oz.au
Mon Jan 5 19:05:40 AEDT 1998


Estimated hours taken: 1

compiler/options.m:
	Fix some bugs in the `--inhibit-warnings' option:
	(1) its sense was inverted and				[zs]
	(2) it was not affecting the settings of the
	    (i) warn_interface_imports and 			[trd]
	    (ii) warn_missing_opt_files options.		[stayl]

Index: options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.215
diff -u -u -r1.215 options.m
--- options.m	1998/01/01 06:05:46	1.215
+++ options.m	1998/01/05 08:00:27
@@ -287,8 +287,9 @@
 	inhibit_warnings	-	bool_special,
 	halt_at_warn		-	bool(no),
 	halt_at_syntax_errors	-	bool(no),
-	% if you add any new warning options, you will need
-	% to modify the handling of inhibit_warnings
+	% if you add any new warning options, or if you change
+	% the default for an existing warning option to `yes',
+	% then you will need to modify the handling of inhibit_warnings
 	warn_singleton_vars	-	bool(yes),
 	warn_overlapping_scopes	-	bool(yes),
 	warn_det_decls_too_lax	-	bool(yes),
@@ -900,12 +901,15 @@
 		], OptionTable0, OptionTable).
 special_handler(inhibit_warnings, bool(Inhibit), OptionTable0, ok(OptionTable))
 		:-
+	bool__not(Inhibit, Enable),
 	override_options([
-			warn_singleton_vars	-	bool(Inhibit),
-			warn_overlapping_scopes	-	bool(Inhibit),
-			warn_det_decls_too_lax	-	bool(Inhibit),
-			warn_nothing_exported	-	bool(Inhibit),
-			warn_simple_code	-	bool(Inhibit)
+			warn_singleton_vars	-	bool(Enable),
+			warn_overlapping_scopes	-	bool(Enable),
+			warn_det_decls_too_lax	-	bool(Enable),
+			warn_nothing_exported	-	bool(Enable),
+			warn_interface_imports	-	bool(Enable),
+			warn_missing_opt_files	-	bool(Enable),
+			warn_simple_code	-	bool(Enable)
 		], OptionTable0, OptionTable).
 special_handler(infer_all, bool(Infer), OptionTable0, ok(OptionTable)) :-
 	override_options([

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list