[Ecls-list] Problem with the compiler

Juan Jose Garcia Ripoll jlr at mpq.mpg.de
Thu Apr 28 07:59:48 UTC 2005


Goffioul Michael wrote:

>I was trying to compile Maxima under ECL and got stuck when compiling one of the
>file (commac.lisp). My compiler (MSVC) refuses to compile the generated code for
>that file. For example, this generated piece of code does not compile:
>
>/*      closure CLOSURE                                               */
>static cl_object LC1(cl_narg narg, cl_object env0, ...)
>{ VT5 VLEX5 CLSR5
>        cl_object value0;
>        {cl_object scan=env0; 
>        CLV1= &CAR(scan);                         /*  TAGBODY                                      */ scan=CDR(scan);
>        CLV0= &CAR(scan);}int i=0;
>        cl_object V1;
>        cl_va_list args; cl_va_start(args,env0,narg,0);
>        V1=cl_grab_rest_args(args);
>        *CLV0= V1;
>        cl_go(*CLV1,MAKE_FIXNUM(0));
>}
>
>It complains when finding the expression "int i=0". Here, there might be 3 issues:
>- There probably should be a new-line and/or ';' after the closing brace (at least under
>  MSVC).
>  
>
Not really.

>- Is it C-compliant to declare variables after a {}-block?
>  
>
This is the real problem. The code that you show contains two separable 
pieces:
- The first block is reponsible for scanning the closure data and 
storing it in local variables for later use.
- The second block grabs the &rest arguments forming a list, which is 
used later on.
- The variable "i" is a counter which is used when parsing &optional 
arguments.
It seems that, instead of being in a block itself, the closure scanning 
phase should surround with braces all code that comes afterwards.
I'll look into that.

Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jlr.vcf
Type: text/x-vcard
Size: 361 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050428/245bf7f8/attachment.vcf>


More information about the ecl-devel mailing list