[Pyrex] Pyrex and GCC4.0

Martijn Faassen faassen at infrae.com
Thu Jun 16 20:29:42 CEST 2005


Martijn Faassen wrote:
> Martijn Faassen wrote:
> 
>> I'll also try to track down what
>> lxml is doing that triggers this behavior even with the patch applied.
> 
> 
> Nothing special, apparently, at least the line that gets translated 
> looks quite innocuous:
> 
> 
>     result._doc = etree
> 
> where result is an extension type instance defined by Pyrex with _doc 
> defined as a C-level element, and etree is another extension type instance
> 
> the translation is something like this:
> 
>   ((PyObject *)__pyx_v_result->__pyx_base._doc) = ((PyObject 
> *)__pyx_v_etree);
> 
> If I understand correctly, to make this work we'd need to change the 
> code generation so it doesn't generate the cast on the left hand side. 
> The right hand side is already casting correctly.

Replying to myself again..this code is generated by the function 
select_code(), line 1592 of Compiler/ExprNodes.py.

This seems to get used in the wrong way in generate_assignment_code in 
line 1651.

Hacking without any guidance by actual knowledge, I created the attached 
patch, which goes on top of John Palmieri's patch (but I applied it to 
0.9.3, and it went cleanly). With that installed, lxml seems to compile 
successfully with gcc 4.0 and the tests run.

Regards,

Martijn





-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.0-hack.patch
Type: text/x-patch
Size: 1512 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20050616/77c6ac04/gcc-4.0-hack.bin


More information about the Pyrex mailing list