library/random.system_rng.m:
Better document the error behaviour of some predicates in this module.
Adjust the header comment to group the description of what happens
on Cygwin with the rest of the Windows description.
Adjust a comment.
library/*.m:
Remove tabled_for_io attributes from C# and Java foreign_procs.
I/O tabling is not supported by those backends.
Remove will_not_modify_trail attributes from C# and Java foreign_procs,
and from predicates that do I/O. They have no effect in the former and
cannot affect anything with the latter.
Fix a spot a where will_not_modify_trail was given, but
will_not_call_mercury was meant.
library/term_io.m:
foramt_term_nl/5 should call format_term_nl_with_op_table/6, *not*
format_term_with_op_table/6, otherwise the terminating ".\n" will
not be written.
tests/hard_coded/Mmakefile:
tests/hard_coded/format_term_nl.{exp,m}:
Add a regression test.
These were inadvertently broken by updates to programming style in
commit 185443d79.
library/rbree.m:
In the implementation of ucount, increment the count for the
current node.
tests/hard_coded/Mmakefile:
tests/hard_coded/rbtree_count.{m,exp}:
Add a regression test.
library/array.m:
library/builtin.m:
library/construct.m:
Fix copy-and-paste errors.
library/arrayd2d.m:
Use the mode array2d_di instead of array_di in a spot.
Delete an extra space from an exception message.
library/bimap.m:
Fix formatting.
library/bit_buffer.m:
Fix inverted argument types.
library/dir.m:
Say that make_single_directory/4 returns an error rather
than saying that it fails.
library/io.m:
Fix errors in obsolete pragmas.
library/assoc_list.m:
library/bag.m:
library/cord.m:
library/deconstruct.m:
library/enum.m:
library/fat_sparse_bitset.m:
library/getopt*.m:
library/int*.m:
library/io*.m:
library/type_desc.m:
Fix documentation errors.
tests/hard_coded/array2d_from_array.exp:
Conform to the changed exception message in array2d.m.
library/char.m:
Fix description of character ranges recognised by hex_digit_to_int/2.
library/pretty_printer.m:
Fix a copy-and-paste error.
library/string.m:
Fix errors in predicate descriptions.
Fix obsolete pragmas that specified the replacement predicate to
be the target of the pragma.
When set, this option tells the compiler to generate warnings
about locally-defined types that are neither used in the module
nor exported to any other module.
compiler/options.m:
Add the new option.
compiler/unused_types.m:
New module to implement the new option.
compiler/mercury_compile_front_end.m:
Invoke the new module, unless the presence of previous errors
would make its warnings just a distraction.
compiler/check_hlds.m:
Include the new module.
compiler/notes/compiler_design.html:
Document the new module.
compiler/typecheck_error_wrong_type.m:
Simplify some code.
browser/declarative_tree.m:
compiler/accumulator.m:
compiler/du_type_layout.m:
compiler/intermod.m:
compiler/mode_errors.m:
compiler/parse_inst_mode_defn.m:
compiler/polyhedron.m:
compiler/split_parse_tree_src.m:
compiler/tag_switch_util.m:
compiler/typecheck_error_unify.m:
compiler/unneeded_code.m:
deep_profiler/mdprof_test.m:
library/getopt.m:
library/getopt_io.m:
Delete unused types reported by the new option.
library/rtti_implementation.m:
Comment out unused type reported by the new option. This type was exported
to both Java and C#, but this diff comments it out because neither language
the Java or the C# runtime system seems to use the exported versions
either. (Bootcheck in both java and csharp grades worked, with the
same number of test case failures as before.) We do not delete it,
because it may be useful in the future.
tests/warnings/help_text.err_exp:
Expect the documentation of the new option.
tests/invalid_nodepend/Mmakefile:
Specify --warn-unused-types for two test cases to test that the compiler
does NOT generate warnings about unused types in the presence of previous
errors.
tests/warnings/abstract_type_decl.err_exp:
tests/warnings/bug412.err_exp:
tests/warnings/warn_dead_procs.err_exp:
Expect the new warnings for unused types.
tests/warnings/Mmakefile:
Specify --warn-unused-types for the three test cases listed above.
This addresses an XXX added by Zoltan in commit eb623b17a,
which misunderstands what the intended semantics of the duration/0
type are.
library/calender.m:
As above.
compiler/add_foreign_proc.m:
The existing code for adding foreign_procs
- tests whether the foreign_proc is for an imported predicate,
and if so, stops with an error message,
- then tests whether the foreign_proc is for the current backend,
and if it is not, ignores the foreign_proc,
- and then both adds the foreign proc to the HLDS, and checks it
for singletons.
Reverse the order of the last two tests, so that we now test
foreign_procs for singletons *even if* they are not for the current
backend. (Though of course we do not add such foreign_procs to the HLDS.)
library/io.environment.m:
library/private_builtin.m:
library/rtti_implementation.m:
Fix the warnings for now result for non-C foreign_procs even during
bootchecks in C grades.
tests/warnings/foreign_singleton.err_exp:
Expect warnings for Java and C# foreign_procs as well as C foreign_procs.
tests/warnings/singleton_test.{m,err_exp}:
tests/warnings/warn_return.{m,err_exp}:
tests/warnings/warn_succ_ind.{m,err_exp}:
Make these test cases more readable. Delete any obsolete parts,
as well as the causes of warnings that these test cases are
not intended to test for. (The latter makes the tests' *outputs*
more readable.)
Expect warnings for Java and C# foreign_procs as well as C foreign_procs,
and expect them with the new line numbers.
tests/warnings/foreign_singleton.err_exp2:
tests/warnings/foreign_singleton.err_exp3:
tests/warnings/singleton_test.err_exp2:
tests/warnings/singleton_test.err_exp3:
tests/warnings/warn_return.err_exp2:
tests/warnings/warn_return.err_exp3:
tests/warnings/warn_succ_ind.err_exp2:
tests/warnings/warn_succ_ind.err_exp3:
Delete these Java- and C#-specific expected outputs, since the warnings
they test for are now in the corresponding .err_exp files.
runtime/mercury_deep_rec_depth_body.h:
Instead assuming that the code #including this file has a variable
named CSD in scope, get the caller to pass that variable via a macro.
library/profiling_builtin.m:
Pass that variable using that macro. Since the macro definition is
not a comment, it won't get a singleton warning. Mark the CSD argument
of the relevant predicates as not-a-singleton.
compiler/foreign.m:
When returning the list of identifiers inside a foreign_proc's code,
ignore the contents of comments. This means that warnings about
variable names that occur in the foreign_proc's argument list
but do not occur in the foreign_proc's code cannot be shut up anymore
by mention the variable name in comments.
The "mostly" part is that typecheck.m still looks at the bodies
of foreign_procs without knowing about comments. Fixing that
will be part a future change.
NEWS.md:
Announce this breaking change.
compiler/fact_table_gen.m:
When we try to generate a foreign_proc's body for a fact table
but cannot do so due to the fact table file not being readable,
add a marker to the predicate that the fact table is for.
compiler/hlds_markers.m:
Update the documentation of the existing predicate marker
we use for this.
compiler/make_hlds_warn.m:
Do not warn about singleton variables in foreign_proc bodies
that are empty due to missing fact table files.
library/array.m:
library/io.file.m:
library/profiling_builtin.m:
library/stm_builtin.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
tests/invalid/erroneous_throw_promise.m:
tests/invalid/foreign_procs_exist_type.m:
tests/invalid/foreign_purity_mismatch.m:
tests/invalid/gh72_errors.m:
tests/invalid_purity/purity.m:
tests/valid/solv.m:
Shut up warnings about singletons in foreign_procs by adding a _ prefix
to the names of the relevant arguments, and delete the comments
that can no longer do that job.
tests/invalid/foreign_purity_mismatch.err_exp:
tests/invalid/gh72_errors.err_exp:
tests/invalid/gh72_errors.err_exp2:
tests/invalid/gh72_errors.err_exp3:
tests/invalid_purity/purity.err_exp:
Expect updated line numbers.
tests/warnings/warn_return.{m,err_exp}:
Extend this test case to test that
- we DO warn about return statements outside comments, but
- we DO NOT warn about return statements inside comments.
library/version_array2d.m:
For every predicate or function that takes an integer argument,
if that integer is required to be non-negative, add an unsigned version.
Add bounds checks to lookup (read) and set (write) operations.
Improve the documentation of the exported operations.
Add a new implementation of the function that returns the rows
of the array as a list of lists.
Improve variable names in operations that have new unsigned versions.
NEWS.md:
Announce the new operations.
tests/hard_coded/version_array2d_test.{m,exp}:
New test case to test the operation of version_array2d.m.
It is based on the applicable parts of version_array_test.m,
but with somewhat improved organization.
tests/hard_coded/Mmakefile:
Enable the new test case.
tests/hard_coded/version_array_test.m:
Minor style fixes.
library/version_array.m:
For every predicate or function that takes an integer argument,
if that integer is required to be non-negative, add an unsigned version.
Improve the documentation of the exported operations.
Improve variable names in operations that have new unsigned versions.
NEWS.md:
Announce the new operations.
tests/hard_coded/version_array_test.m:
Modify this test case to test the new operations.