[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback |
Date: |
Tue, 10 Nov 2009 18:41:36 -0000 |
#113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback
------------------------+---------------------------------------------------
Reporter: jeronimo | Owner:
Type: defect | Status: new
Priority: minor | Milestone:
Component: extensions | Version: 4.2.x
Keywords: crunch |
------------------------+---------------------------------------------------
Comment(by jeronimo):
Hi Felix,
The code you showed doesn't compile here (?)
I've updated crunch to 0.7.3, but
{{{
new-crunch-bug.cpp: In function ‘type32 f31(type30)’:
new-crunch-bug.cpp:58: error: ‘crunch_callback8’ was not declared in this
scope
new-crunch-bug.cpp: In function ‘void C_toplevel(long int, long int, long
int)’:
}}}
but crunch_callback8 is only declared in line 78.
Line 58 is:
{{{
type50 t51 = crunch_callback8(t49); // foo
}}}
I have put the declaration of crunch_callback8 at the top of the C++ file,
and then it worked perfectly!
{{{
$ g++ -o new-crunch-bug -lchicken new-crunch-bug.o
$ ./new-crunch-bug
Here's your int: 0
Here's your int: 1
Here's your int: 2
Here's your int: 3
Here's your int: 4
Here's your int: 5
Here's your int: 6
Here's your int: 7
Here's your int: 8
Here's your int: 9
}}}
So, the only remaining issue seems to be that callbacks are not declared
before they are used. (But maybe this depends on local setup? You said it
worked for you)
As to the void problem, that's OK -- I can make all my callbacks return
ints. :-)
--
Ticket URL: <http://www.irp.oist.jp/trac/chicken/ticket/113#comment:3>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/09
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/09
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/10
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback,
Chicken Trac <=
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/10
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/10
- [Chicken-janitors] Re: #113: Crunch egg: bug in define-crunch-primitives / define-crunch-callback, Chicken Trac, 2009/11/10