Robert Bradshaw | 2 Nov 23:14 2009

Re: [Cython] More complex bugs

On Nov 2, 2009, at 11:53 AM, Dag Sverre Seljebotn wrote:

> Robert Bradshaw wrote:
>> On Oct 28, 2009, at 8:39 AM, Dag Sverre Seljebotn wrote:
>>> I just added
>>> Basically,
>>> ctypedef float myfloat;
>>> ...
>>> print some_myfloat * some_complex
>>> miscompiles as "some_myfloat" is coerced to "myfloat  
>>> complex" (which,
>>> interestingly, is a type which can't be created or used in any other
>>> way!)
>>> Fixing this requires some thought.
>>> This probably broke because (in order to fix another bug) I stepped
>>> away
>>> from "the order something is needed in Cython decides output order  
>>> in
>>> C". I believe that was a correct decision and don't want to step  
>>> back.
>>> The proper solution is a DAG of all types and their dependencies. I
>>> believe that is a bit heavy/destabilizing for 0.12 though. Perhaps
>>> output all very simply typedefs (typedefs of ints and floats) first,
>>> then complex, then the rest?
>> Yep, I don't see the full DAG analysis happening in 0.12. I think any
>> arbitrary order we come up with is potentially prone to errors. I'm  
>> OK
>> with just disallowing that for 0.12, it's not a regression.
> OK, I disabled it as I likely won't have time for a proper fix:

Thanks. I'm still hoping to get an alpha out very soon... There's  
another regression, "cdef int complex" doesn't work anymore (our  
structs used to support this, as does gcc, even if it's non-c99).

> (Did you do all of 
> 82d312a9f1fc by
> hand? Either way I'm impressed, thanks a lot!)

I did write a script to do most of that (though I'll admit it was kind  
of hackish and still required too much manual touchup in some files).

- Robert