chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] chicken generates bad C code here


From: Joerg F. Wittenberger
Subject: [Chicken-users] chicken generates bad C code here
Date: 22 Nov 2003 15:32:22 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi Felix,

Here is a snippet from generated code and the related source parts.  I
could imagine, that the problem is obvious to you from these parts;
tell me if you need a complete example.

t22=C_mutate((C_word*)lf[112]+1,(*a=C_CLOSURE_TYPE|1,a[1]=(C_word)f_4345,tmp=(C_word)a,a+=2,tmp));
t23=C_mutate((C_word*)lf[223]+1,C_retrieve(lf[220]));
t24=C_mutate((C_word*)lf[111]+1,(*a=C_CLOSURE_TYPE|1,a[1]=(C_word)f_4380,tmp=(C_word)a,a+=2,tmp));
t25=C_mutate((C_word*)lf[224]+1,C_retrieve(lf[225]));
t26=C_mutate((C_word*)lf[226]+1,(*a=C_CLOSURE_TYPE|1,a[1]=(C_word)(quote 
A_addstr5),tmp=(C_word)a,a+=2,tmp));

/* Note: "(quote A_addstr5)" instead of "A_addstr5" here */

t27=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_4416,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
C_trace("condition-predicate");
t28=C_retrieve(lf[550]);
((C_proc3)C_retrieve_proc(t28))(3,t28,t27,lf[547]);}

/* k4414 in k3475 in k3257 in k3013 in k3009 in k3005 in k3002 in k2999 in 
k2996 in k2993 in k2990 in k2987 in k2984 in k2981 in k2978 in k2975 in k2972 */


 (foreign-declare #<<EOF

#include <time.h>

static void A_addstr5(C_word c, C_word self, C_word k,
                      C_word s_buf, C_word s_i, C_word s_str, C_word s_j,
                      C_word s_flush) C_noret;

static void A_addstr5(C_word c, C_word self, C_word k,
                      C_word s_buf, C_word s_i, C_word s_str, C_word s_j,
                      C_word s_flush)
{
  int i = C_unfix(s_i), j = C_unfix(s_j);

...

(define string-splice! (##core#primitive "A_addstr5"))

...

best regards

/Jörg

-- 
The worst of harm may often result from the best of intentions.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]