[PyQt] sipdistutils.py - broken exceptions flags in VC++

Phil Thompson phil at riverbankcomputing.com
Tue Nov 4 20:05:06 GMT 2014


On 04/11/2014 7:50 pm, Matteo Italia wrote:
> So nobody is using setup.py to build SIP extensions? Is there any place
> where to send patches, anyhow?

I don't want to make changes to sipdistutils.py at this stage. I don't 
recommend using it and it won't be part of sip5.

Phil

> Il 27/10/2014 23:27, Matteo Italia wrote:
>> Hello,
>> 
>> when building a Python 2.7 extension on Windows (with VC++ 2008) 
>> through
>> sipdistutils.py, I spotted several warning about wrong exception 
>> flags.
>> 
>> The issue seems to be that distutils only bothers to provide a 
>> compiler
>> with build options adequate for C extensions
>> (http://bugs.python.org/issue1222585), while we need C++ settings. For
>> this reason, no /EH flag is provided, and we end up building 
>> extensions
>> with broken exception semantic (in particular, RAII seems to be
>> completely broken when no /EH is provided, and catch(...) catches also
>> SEH exceptions, which is _extremely_ bad).
>> 
>> To fix this issue, I patched sipdistutils.py to add the adequate
>> exception specification option (/EHsc) if not present (and complain if
>> some /EH which is not /EHsc is already present); attached you can find
>> the diff against the sipdistutils.py in the current repository (since 
>> it
>> already goes on checking command line arguments, there's also a check 
>> to
>> remove -Wstrict-prototypes on Unix, which just generates noise in the
>> build).
>> 
>> Could someone check if it looks ok and if it can be eventually merged
>> back in SIP? I already had several bizarre crashes that could be 
>> traced
>> back to this problem, so I think that this may be useful to others.
>> 
>> Regards,
>> Matteo
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list