[Pyrex] Please support C++
Lenard Lindstrom
len-l at telus.net
Mon Oct 17 23:52:02 CEST 2005
On 13 Oct 2005 at 16:35, Greg Ewing wrote:
> Lenard Lindstrom wrote:
>
> > I've made a few changes to the Pyrex-0.9.3.1 compiler so it now produces C code
> > that also compiles as C++ for some Pyrex programs.
[snip]
> > [H]how is the best way to make the patch available for general testing? At 7.5K
> > is it too large to be an e-mail attachment?
>
> You're welcome to mail it to me and I'll put it on the
> web page somewhere for people to try out.
>
Update on C++ support.
I can now compile all the Pyrex programs in directories 1 - 8 of the Pyrex test suite
as C++. But I would like to do some more rigorous testing of extension types, the
problem area, before submitting a patch.
I do have one question regarding temporary object pointers. Pyrex has code to
ensure all such pointers are (PyObject *). I took out that restriction to allow
temporary pointers to extension types to be of the type of the extension type. This
simplifies the generation C casts. It appears the compiler originally allowed for non
(PyObject *) pointers. Does removing the restriction re-introduce some kind of bug?
I have been chasing down the places in the compiler where explicit casts to
(PyObject *) are made and replacing them with
"(%s)" % <target_type>.declaration_code("").
Lenard Lindstrom
<len-l at telus.net>
More information about the Pyrex
mailing list