[M3devel] config init problem

jay.krell at cornell.edu jay.krell at cornell.edu
Sat Aug 22 12:34:29 CEST 2009


Ignoring errors is very common and usually wrong. Better to have a  
system terminate than keep running in an unknown state..

"exceptions are better than error return codes" because they have the  
proper default -- to propagate -- but 1 they still lead to many bugs  
because lazy programmers still do play along in the escalating game  
and put in extra code to do the wrong thing and eat exceptions 2  
disciplined C programmers know that almost anything can fail and can  
spot missing error checks at a glance.
To wit even simple integer arithmetic can overflow. Look at the  
intsafe.h header on windows for what to do about that.

  - Jay (phone)

On Aug 21, 2009, at 6:16 PM, Olaf Wagner <wagner at elegosoft.com> wrote:

> In MxConfig.m3 quake runtime exception were ignored and thrown away
> in EvalConfig. Writing them to stderr, we get the following output
> for a simple cm3.cfg file:
>
> % cat ~/cm3-rc3/bin/cm3.cfg
>
> %INSTALL_ROOT = "/ad0e/home/wagner/cm3-rc3"
> INSTALL_ROOT = path() & SL & ".."
>
> include(path() & "/config/FreeBSD4")
>
> luthien [~/work/cm3] wagner
> % cm3 -trace -version
> Critical Mass Modula-3 version p5.8.3
>  last updated: 2009-08-10
>  compiled: 2009-08-21 22:59:34
>  configuration: /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg
>  host: FreeBSD4
> ****** /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg ******
> .0    SetLine  1
> .1    SetLine  3
> .2    LoadVar  (193) "path"
> .3    StartCall
> .4    CallFunc  0
> .5    LoadVar  (373) "SL"
> quake runtime error: "/ad0e/home/wagner/cm3-rc3/bin/cm3.cfg", line  
> 3: quake runtime error: undefined variable: SL
>
> --procedure--  -line-  -file---
>                    3  /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg
>  target:
>
> SL gets defined in M3Build.m3 in cm3, along with all the other
> builtins that the compiler may use (and the config file author).
> Of course MxConfig in package m3quake does not know about these,
> as it creates its own quake machine on the fly.
>
> So configuration evaluation won't work in general currently,
> unless only standard quake functions and definitions are used.
>
> Any ideas?
>
> Olaf
> -- 
> Olaf Wagner -- elego Software Solutions GmbH
>               Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germ 
> any
> 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: Be 
> rlin
> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr:  
> DE163214194
>
>



More information about the M3devel mailing list