[Pyrex] pyrex and g++

Lenard Lindstrom len-l at telus.net
Fri Sep 23 22:51:27 CEST 2005


I don't think the problem is making Pyrex generate code that can compile as C++. I 
think the problem is that the module will be used by an interpreter written and 
compiled in pure C. What happens if a C++ exception is thrown and not caught 
before returning to interpreter's call on a module function. Will the C stack continue 
to unwind and cause the interpreter to crash? Does declaring a C++ function 'extern 
"C"' ensure that any unhandled C++ exceptions are stopped in their tracks before 
they can do harm in C code? ( A quick test using MinGW 3.2.3 shows an exception 
thrown by a C++ function in a dynamic library causes an abnormal termination in a 
C program calling it.)

Lenard Lindstrom
<len-l at telus.net>


On 22 Sep 2005 at 21:36, Josiah Carlson wrote:

> 
> Simon Burton <simon at arrowtheory.com> wrote:
> > 
> > On Fri, 23 Sep 2005 15:22:56 +1200
> > Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > 
> > > 
> > > Pyrex generates C code, not C++ code, meaning you have to
> > > compile its output as C, not C++. In other words, use
> > > the command 'gcc', not 'g++'.
> > 
> > OK, this sounds like you are not even interested in considering becoming
> > "c++ compliant". Fair enough.
> 
> I'm sure Greg would be willing to accept patches and testcases for
> giving Pyrex a C++ backend if you are willing to put in the work.
> 




More information about the Pyrex mailing list