compiler/make_hlds_passes.m:
We used to add all modules imported by an ancestor of the current module
to the set of used modules. Once upon a time, this was meant to stop
the compiler generating misleading warnings about imports being unused
when the import wasn't even done by the current module. However, since
we introduced structured representations of import- and use_module
declarations and taught unused_imports.m to use them, that has not been
an issue. However, a bad side-effect remained, which was that if
a module A imported a module B but did not use it, or it imported
module B in its interface but did not use in its interface, then
any warning we could generate about that import being unused was
suppressed by any import of module B in any of module A's ancestors.
(The "shadowing" mentioned above.)
Fix the problem by adding modules imported by ancestors of the
current module NOT to the set of used modules, but to a new field
in the module_info.
compiler/hlds_module.m:
Add this new field. As it happens, it is not needed right now,
but it may be needed later.
Update some documentation.
Note an only-tangentially-related problem.
compiler/unused_imports.m:
Fix a bug that was hiding behind the shadowing, which was that whether
the text of the warning message we generated for an unused local import-
or use_module declaration could be affected by the presence of an
import- or use_module declaration in an ancestor module.
Improve debugging infrastructure.
Make a predicate name more descriptive.
NEWS:
Announce the bugfix.
compiler/add_pragma_tabling.m:
compiler/add_solver.m:
compiler/add_type.m:
compiler/parse_string_format.m:
compiler/recompilation.usage.m:
compiler/recompilation.used_file.m:
library/io.call_system.m:
library/io.text_read.m:
library/random.sfc32.m:
library/random.sfc64.m:
library/random.system_rng.m:
library/string.parse_runtime.m:
library/string.parse_util.m:
library/string.to_string.m:
library/thread.closeable_channel.m:
mdbcomp/feedback.automatic_parallelism.m:
Delete imports that the fixed compiler now generates unused import
warnings for.
library/random.system_rng.m:
Shift most of the #includes into a local foreign_decl pragma
so that they do not get included in the .mh file.
Position the C# and Java foreign code pragmas to the end of the file,
with the C one.
library/random.system_rng.m:
Document what sources of randomness are used by the C backends.
library/MODULES_DOC:
library/MODULES_UNDOC:
Include random.system_rng module in the library documentation.
NEWS:
Announce the random.system_rng module.
Ensure it is not possible to use a system RNG handle after it has been closed
with the arc4random() and rand_s() based implementations.
library/random.system_rng.m:
As above.
Ensure it is not possible to use a system RNG handle after it has been closed
in the C# and Java grades. This brings the implementation for these backends
into line with the /dev/urandom implementation on C. (The other C implementation
will be made to conform in a separate change.)
library/random.system_rng.m:
Add wrapper classes around the C# and Java system RNGs that allow
us to track if they have already been closed.
On Windows we implement the system RNG by calling the CRT's rand_s() function.
library/random.system_rng.m:
Implement the system RNG on Windows using rand_s().
runtime/mercury_std.h:
On Windows define the macro _CRT_RAND_S before the initial
inclusion of stdlib.h -- we must do this otherwise the declaration
of rand_s() will not be visible.
library/random.system_rng.m:
As above.
Use the arc4random() based implementation on FreeBSD >= 12.0
and macOS >= 10.12, falling back to the urandom approach on earlier
versions.
Always use the arc4random() approach on NetBSD and OpenBSD,
both of which have used ChaCha20 in their implementation
of arc4random() since 2014.
Add a system RNG implementation for the C backends that works by
reading random bits from /dev/urandom. We use this on Linux,
AIX and Solaris.
library/random.system_rng.m:
Add two implementations of the system RNG for the C backends, one that
reads from /dev/urandom and one that just aborts. The former is used
on Linux and the latter is used everywhere else (for now).
This is work-in-progress, currently only the C# and Java backends
are supported. Support for the C backends will be added separately.
library/random.system_rng.m:
A new submodule containing the system RNG.
library/random.m:
library/library.m:
Include the new submodule.
library/MODULES_UNDOC:
Do not generate documentation for the new submodule.