[M3devel] Disabling runtime checks

Olaf Wagner wagner at elegosoft.com
Thu Nov 29 23:08:58 CET 2007


Quoting Henning Thielemann <lemming at henning-thielemann.de>:

>
> On Thu, 29 Nov 2007, Tony Hosking wrote:
>
>> m3_option("-NoChecks")  should do it.
>
> Is this documented somewhere?

Actually yes, it is:

http://modula3.elegosoft.com/pm3/pkg/m3build/src/html/m3options.html

But I'm afraid that the documentation hasn't been updated for
CM3 5.x in this respect, as Critical Mass never release it and
Michael and I simply had not the resources to check every detail.
So it will be out of date :-(

>> For assertions use m3_option("-NoAsserts").
>
> $ cm3 -O -A -keep
> unsupported m3_option value: "-NoChecks"

That's what I meant ;-/

> Sorry, it's not the newest version:
>
> $ cm3 -version
> Critical Mass Modula-3 version 5.2.6
>   last updated: 2003-06-27
>   configuration: /usr/local/cm3/bin/cm3.cfg

Later does not necessary mean better documented.

A quick grep through the code does produce this though:
.../cm3/m3-sys/m3front/src/misc/Host.m3

     ELSIF (Text.Equal (t, "-NoChecks")) THEN
       doAsserts   := FALSE;
       doNarrowChk := FALSE;
       doRangeChk  := FALSE;
       doReturnChk := FALSE;
       doCaseChk   := FALSE;
       doTCaseChk  := FALSE;
       doNilChk    := FALSE;
       doRaisesChk := FALSE;
       doDebugs    := FALSE;

So actually it seems like it should work; perhaps only the m3_option
embedding is broken.
...
It seems to be set from M3_OPTIONS in cm3.cfg:

     s.m3_options     := GetConfigArray (s, "M3_OPTIONS");

So I'd try to set it there. Perhaps

   cm3 -D'M3_OPTIONS=[ "NoChecks" ]"

will work, too.

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list