Ok, I've done a bit of testing and the problem seems to be in recursive
ctypedef's.

Eg.

ctypedef struct foo:
        int count
        foo *bar

causes the bug in the outputted code.  Remove the reference to itself and
the problem goes away.

cdef struct foo:
        int count
        foo *bar

compiles fine.  I'm guessing that even if a recursive type def isn't
allowed, then the cython
translator should complain about it before gcc is ever invoked.  The easy
way around it is to
do the C thing and do a plain cdef first, then do the ctypedef like

cdef struct foo:
        int count
        foo *bar

ctypedef foo FOO

Hope this helps.
-Tim

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Bradshaw
Sent: Saturday, 22 November 2008 6:16 PM
To: [email protected]
Subject: Re: [Cython] Errors in generated .c

On Nov 21, 2008, at 10:31 PM, Tim Wakeham wrote:

> Hi guys,
>
> I've just begun playing with Cython over the last few days,

Cool.

> but I've come
> across what appears to be errors in the generated .c file.

No promises that it's bug free yet. :) Thanks for the report.

> When I try to build this source file http://pastebin.com/f686e0ac I  
> receive
> the output below from MingW.  The entire source package is  
> available at
> http://hiddenworlds.org/temp/Jupiter.zip if that helps.

What would really help is a minimal example  that reproduce this  
error. (E.g. one two very short files, just keep cutting until you  
can't cut any more.) Then we could go in and try and figure out  
what's going wrong.

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to