[m-rev.] for review: --no-warn-inferred-erroneous

Peter Ross peter.ross at miscrit.be
Fri Feb 8 19:35:26 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 1
Branches: main

Add the option --no-warn-inferred-erroneous.  This option means that the
compiler doesn't warn about determinism declarations which are too lax
because their inferred determinism is erroneous.  This allows one to use
--halt-at-warn with programs with unimplemented predicates which throw
errors.

compiler/det_report.m:
compiler/options.m:
doc/user_guide.texi:
    Add the --no-warn-inferred-erroneous option.


Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.68
diff -u -r1.68 det_report.m
--- compiler/det_report.m	11 Aug 2001 14:09:37 -0000	1.68
+++ compiler/det_report.m	8 Feb 2002 08:36:04 -0000
@@ -180,6 +180,9 @@
 			globals__io_lookup_bool_option(
 				warn_det_decls_too_lax,
 				ShouldIssueWarning),
+			globals__io_lookup_bool_option(
+				warn_inferred_erroneous,
+				WarnAboutInferredErroneous),
 			{ pred_info_get_markers(PredInfo0, Markers) },
 			(
 				{ ShouldIssueWarning = yes },
@@ -199,7 +202,18 @@
 				% happen for the Unify pred for the unit type,
 				% if such types are not boxed (as they are not
 				% boxed for the IL backend).
-				{ \+ code_util__compiler_generated(PredInfo0) }
+				{ \+ code_util__compiler_generated(PredInfo0) },
+
+				% Don't warn about predicates which are
+				% inferred erroneous when the appropiate
+				% option is set.  This is to avoid
+				% warnings about unimplemented
+				% predicates.
+				{ WarnAboutInferredErroneous = yes,
+					true
+				; WarnAboutInferredErroneous = no,
+					InferredDetism \= erroneous
+				}
 			->
 				{ Message = "  warning: determinism declaration could be tighter.\n" },
 				report_determinism_problem(PredId,
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.352
diff -u -r1.352 options.m
--- compiler/options.m	7 Feb 2002 07:21:14 -0000	1.352
+++ compiler/options.m	8 Feb 2002 08:36:07 -0000
@@ -58,6 +58,7 @@
 		;	warn_singleton_vars
 		;	warn_overlapping_scopes
 		;	warn_det_decls_too_lax
+		;	warn_inferred_erroneous
 		;	warn_nothing_exported
 		;	warn_unused_args
 		;	warn_interface_imports
@@ -553,6 +554,7 @@
 	warn_singleton_vars	-	bool(yes),
 	warn_overlapping_scopes	-	bool(yes),
 	warn_det_decls_too_lax	-	bool(yes),
+	warn_inferred_erroneous	-	bool(yes),
 	warn_nothing_exported	-	bool(yes),
 	warn_unused_args	-	bool(no),
 	warn_interface_imports	-	bool(yes),
@@ -1021,6 +1023,7 @@
 long_option("warn-singleton-variables",	warn_singleton_vars).
 long_option("warn-overlapping-scopes",	warn_overlapping_scopes).
 long_option("warn-det-decls-too-lax",	warn_det_decls_too_lax).
+long_option("warn-inferred-erroneous",	warn_inferred_erroneous).
 long_option("warn-nothing-exported",	warn_nothing_exported).
 long_option("warn-unused-args",		warn_unused_args).
 long_option("warn-interface-imports",	warn_interface_imports).
@@ -1569,6 +1572,7 @@
 			warn_singleton_vars	-	bool(Enable),
 			warn_overlapping_scopes	-	bool(Enable),
 			warn_det_decls_too_lax	-	bool(Enable),
+			warn_inferred_erroneous	-	bool(Enable),
 			warn_nothing_exported	-	bool(Enable),
 			warn_interface_imports	-	bool(Enable),
 			warn_missing_opt_files	-	bool(Enable),
@@ -1888,6 +1892,9 @@
 		"--no-warn-det-decls-too-lax",
 		"\tDon't warn about determinism declarations",
 		"\twhich could have been stricter.",
+		"--no-warn-inferred-erroneous",
+		"\tDon't warn about determinism declarations which are",
+		"\inferred erroneous but are declared a more lax determinism.",
 		"--no-warn-nothing-exported",
 		"\tDon't warn about modules which export nothing.",
 		"--warn-unused-args",
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.289
diff -u -r1.289 user_guide.texi
--- doc/user_guide.texi	7 Feb 2002 03:55:52 -0000	1.289
+++ doc/user_guide.texi	8 Feb 2002 08:36:14 -0000
@@ -3478,6 +3478,13 @@
 which could have been stricter.
 
 @sp 1
+ at item --no-warn-inferred-erroneous
+ at findex --no-warn-inferred-erroneous
+ at findex --warn-inferred-erroneous
+Don't warn about determinism declaration which are inferred erroneous
+but whose declarations are more lax.
+
+ at sp 1
 @item --no-warn-nothing-exported
 @findex --no-warn-nothing-exported
 @findex --warn-nothing-exported

--------------------------------------------------------------------------
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