[Cython] Robert, please help!

Lisandro Dalcin dalcinl at gmail.com
Fri Oct 10 00:54:50 CEST 2008


You have attached three different patches fixing this in different
ways. But I really believe the #3 is the best, safest one.

You also have a small pyx file in orther you can easily spot the
geneated code and the behavior of patch #3. WARNING: You have to
generate C sources and test with

$ cython --cleanup 9 modglbinit.pyx
$ <gcc modglbinit,c -> modglbinit.so>
$ python -c 'import modglb'

This example is vile hackery, and SHOULD NOT be included in the
testsuite right now (unless the testsuite generates C sources with
--cleanup options?). Perhaps if --cleanup could be passed as a
directive, then it could go in.


On Thu, Oct 9, 2008 at 7:15 PM, Robert Bradshaw
<robertwb at math.washington.edu> wrote:
>
> On Oct 3, 2008, at 9:29 PM, Lisandro Dalcin wrote:
>
>> OK, at this link http://publications.gbdirect.co.uk/c_book/chapter8/
>> typedef.html
>>
>> I've found the following example:
>>
>> /*
>> * Using typedef, declare 'func' to have type
>> * 'function taking two int arguments, returning int'
>> */
>> typedef int func(int, int);
>> /* ERROR */
>> func func_name{ /*....*/ }
>> /* Correct. Returns pointer to a type 'func' */
>> func *func_name(){ /*....*/ }
>> /*
>> * Correct if functions could return functions,
>> * but C can't.
>> */
>> func func_name(){ /*....*/ }
>>
>>
>> I'm fine with that. So I´ll try tomorrow if Robert´s modifications can
>> handle this form. Thank's for the point, Greg!
>>
>
> Lisandro,
>
> What was the final resolution on this?
>
> - Robert
>
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup_option1.diff
Type: text/x-patch
Size: 1266 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20081009/69863e9f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup_option2.diff
Type: text/x-patch
Size: 743 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20081009/69863e9f/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup_option3.diff
Type: text/x-patch
Size: 1006 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20081009/69863e9f/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modglbinit.pyx
Type: application/octet-stream
Size: 601 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20081009/69863e9f/attachment.obj 


More information about the Cython-dev mailing list