mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 20:33:55 +00:00
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.
2.3 KiB
2.3 KiB
gh72_errors.m:028: Warning: this `:- import_module' declaration for module
gh72_errors.m:028: `solutions' is out of order with respect to the preceding
gh72_errors.m:028: `:- import_module' declaration for module `string'.
gh72_errors.m:051: Error: the definition of predicate `test_export_1'/3 cannot
gh72_errors.m:051: be exported to C as `exported_test_export_1', because
gh72_errors.m:051: predicate `test_export_1'/3 has a nonstandard and
gh72_errors.m:051: undocumented calling convention due to interactions
gh72_errors.m:051: between its use of partially instantiated data structures
gh72_errors.m:051: and the `direct_arg' data representation optimization.
gh72_errors.m:069: Error: the definition of predicate `test_export_2'/5 cannot
gh72_errors.m:069: be exported to C as `exported_test_export_2', because
gh72_errors.m:069: predicate `test_export_2'/5 has a nonstandard and
gh72_errors.m:069: undocumented calling convention due to interactions
gh72_errors.m:069: between its use of partially instantiated data structures
gh72_errors.m:069: and the `direct_arg' data representation optimization.
gh72_errors.m:102: Error: a procedure implemented using a
gh72_errors.m:102: `:- pragma foreign_proc' declaration may not have any
gh72_errors.m:102: arguments whose types use the `direct_arg' data
gh72_errors.m:102: representations optimization, and whose modes indicate
gh72_errors.m:102: that they fill in partially instantiated terms. Argument 1
gh72_errors.m:102: of predicate `direct_arg_in_out_0_test_fproc_1'/3 mode 0
gh72_errors.m:102: violates this prohibition.
gh72_errors.m:124: Error: a procedure implemented using a
gh72_errors.m:124: `:- pragma foreign_proc' declaration may not have any
gh72_errors.m:124: arguments whose types use the `direct_arg' data
gh72_errors.m:124: representations optimization, and whose modes indicate
gh72_errors.m:124: that they fill in partially instantiated terms. Arguments
gh72_errors.m:124: 2 and 3 of predicate `direct_arg_in_out_0_test_fproc_2'/5
gh72_errors.m:124: mode 0 violate this prohibition.
gh72_errors.m:028: `solutions' is out of order with respect to the preceding
gh72_errors.m:028: `:- import_module' declaration for module `string'.
gh72_errors.m:051: Error: the definition of predicate `test_export_1'/3 cannot
gh72_errors.m:051: be exported to C as `exported_test_export_1', because
gh72_errors.m:051: predicate `test_export_1'/3 has a nonstandard and
gh72_errors.m:051: undocumented calling convention due to interactions
gh72_errors.m:051: between its use of partially instantiated data structures
gh72_errors.m:051: and the `direct_arg' data representation optimization.
gh72_errors.m:069: Error: the definition of predicate `test_export_2'/5 cannot
gh72_errors.m:069: be exported to C as `exported_test_export_2', because
gh72_errors.m:069: predicate `test_export_2'/5 has a nonstandard and
gh72_errors.m:069: undocumented calling convention due to interactions
gh72_errors.m:069: between its use of partially instantiated data structures
gh72_errors.m:069: and the `direct_arg' data representation optimization.
gh72_errors.m:102: Error: a procedure implemented using a
gh72_errors.m:102: `:- pragma foreign_proc' declaration may not have any
gh72_errors.m:102: arguments whose types use the `direct_arg' data
gh72_errors.m:102: representations optimization, and whose modes indicate
gh72_errors.m:102: that they fill in partially instantiated terms. Argument 1
gh72_errors.m:102: of predicate `direct_arg_in_out_0_test_fproc_1'/3 mode 0
gh72_errors.m:102: violates this prohibition.
gh72_errors.m:124: Error: a procedure implemented using a
gh72_errors.m:124: `:- pragma foreign_proc' declaration may not have any
gh72_errors.m:124: arguments whose types use the `direct_arg' data
gh72_errors.m:124: representations optimization, and whose modes indicate
gh72_errors.m:124: that they fill in partially instantiated terms. Arguments
gh72_errors.m:124: 2 and 3 of predicate `direct_arg_in_out_0_test_fproc_2'/5
gh72_errors.m:124: mode 0 violate this prohibition.