[m-dev.] warning suppression pragmas

Julien Fischer jfischer at opturion.com
Mon May 27 17:10:24 AEST 2013

On Mon, 27 May 2013, Zoltan Somogyi wrote:

> On 27-May-2013, Julien Fischer <jfischer at opturion.com> wrote:
>> A modification of this proposal is to add another pragma that suppresses
>> module level warnings.
>>     :- pragma suppress_module_warnings([<module warnings>]).
>> Under this proposal the original, suppress_warnings/2 pragma would become:
>>     :- pragma suppress_pred_warnings(<pred>/<arity>, [<pred warnings>])
> I like this, but what module level warnings are you thinking of?

The main ones (for modules) would be --warn-nothing-exported and 
--warn-interface-imports.  This tends to affect every library that uses
dummy module to force the compiler to generate the correct library name.
(e.g. Mercury's standard library among others.)

>> I am looking for feedback about whether either of my proposed
>> generalisations should be implemented.
> That depends. What warnings are you getting that are annoying enough
> often enough that you want to put in the time to implement this?

The I listed above are.  (Often you want to have "mercury" or "mer"
in the library name but use a different name for the top-level
module, in particular with bindings to foreign libraries you cannot
use the name foo, because libfoo.* already exists for C, C++ etc
on the system.)

Also, this sort of thing tends to clutter up Mercury.options files
and I would prefer warnings suppression to be placed in the same
file as the module or predicates that the affect.


More information about the developers mailing list