Mercury Bugs - mercury
View Issue Details
0000507mercuryFeature Requestpublic2020-05-01 17:522020-05-01 17:52
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000507: detect missing foreign_procs
DescriptionWe should add a compiler option that causes the compiler
to generate a warning for every procedure that passes neither
of the following tests:

Test 1: it has a Mercury definition.

Test 2: it has a definition in each of C, Java, C# and (maybe) Erlang.

The test is for procedures, not predicate or functions,
because foreign_procs are for procedures, and with mode-specific
clauses, Mercury clauses can be as well. However, if a predicate
or function has two or more procedures, and they all fail both tests,
we should probably generate one message, not several.

At the moment, I believe a substantial chunk of the test case failures
in C# and Java grades are caused by missing foreign_procs for these
languages that this option should help us find more easily. More important,
enabling this warning for all modules in the library, which is compiled with
--halt-at-warn, should help us not just to fix this, but *keep* it fixed.

As for the option name, how about --warn-missing-foreign-procs?
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2020-05-01 17:52zsNew Issue