I tried this again under VS.NET 2003. Again, building a project with lib*.c and gsi*.c, adding <gambit>\include to the include paths. I also suppressed a few warnings related to coercions.
Could you send me a list of the warnings? I have already fixed a bunch of coercion problems between beta 10 and beta 11.
Here are the error messages:
c:\Projects\Gambit\gambc40b11\lib_num.c(52351): fatal error C1071: unexpected end of file found in comment
I believe the problem is expressed in line 44720 of _num.c. Here's that line:
___SET_F64(___F64V2,___F64DIV(___F64V1,___F64UNBOX(___GLO(53,___G__23__23_bignum_2e_inexact_2d_mdigit_2d_base))))
I think what's going on is the ___F64UNBOX() is returning a string that starts with '*' so the ___F64DIV expands to a string with '/*' in it.
Here's the definition of ___F64DIV:
#define ___F64DIV(x,y)(x/y)
Changing this to
#define ___F64DIV(x,y)(x/(y))
... eliminates the error. This same problem occurs in two other functions:
#define ___F64INV(x)1.0/x #define ___FIXINV(x)___FIX((___FIX(1)/x))
I added parens around the x's and it compiles now.
Great! I suspected something like this was going on and I'm glad you pinpointed the problem.
After running it, I got a console window and running some sort of command line program. I tried to define factorial and got this error when I typed the first ')':
Run-Time Check Failure #3 - The variable 'e' is being used without
being defined. line 2690 of os_tty.c
That line is at the end of this function:
lineeditor_output_terminal_op_move_abs
I changed the declaration of e (the unbound variable to be this:
___SCMOBJ e = ___FIX(___NO_ERR);
and it successfully ran (fact 1000). I haven't played with it further yet.
Nice catch. Which version of MS VC are you using? Did you use any special options to get these error checks?
Is there a test suite?
Try "make check". You may have to install MinGW to get make. Otherwise look at tests/makefile and do the steps manually.
Marc