Re: Compiler crash?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thomas Jansen wrote:
> When i compile this program with Watcom the program open a console window with
> no output.
> Using Borland it produce the usual window error message. 
> Is it a bug in ecw?
> 
> exw test-mydll.exw -- ok
> bind test-mydll.exw -- ok
> ecw -wat test-mydll.exw -- console no output
> ecw -bor test-mydll.exw -- crash with windows error.
> 
> --------- test-mydll.exw
> without warning
> include dll.e
> 
> atom dll, up
> 
> dll = open_dll("mydll")
> up = define_c_func(dll, "upper", {E_OBJECT}, E_OBJECT)
> 
> -- puts(1, c_func(up, {"aBcDEfg"}))
> for n=1  to  1000  do
>     puts(1, c_func(up, {rand("abcdefghijklmnopqrstuv") + ' '}) & '\n')
> end for
> 
> while get_key() = -1 do
>     
> end while
> 
> --------- mydll.ew
> 
> function to_upper(sequence s)
>     integer i
>     for c=1  to length(s)  do
> 	i = s[c]
> 	if i >= 'a' then
> 	    if i <= 'z' then
> 		s[c] -= ' '
> 	    end if
> 	end if
>     end for
>     return s
> end function
> 
> global function upper(object x)
> 
>     return to_upper(x)
> end function

Thanks for reporting this.
I haven't had time to pin it down exactly. (It's getting late here.)
It's probably a code generation error.
Meanwhile, for me at least, the bug goes away if you use two
calls to puts() inside the for-loop instead of one:
puts(1, c_func(up, {rand("abcdefghijklmnopqrstuv") + ' '}))
    puts(1, '\n') 


Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu