[PyQt] sipdistutils.py - broken exceptions flags in VC++
Matteo Italia
matteo at mitalia.net
Tue Nov 4 19:50:28 GMT 2014
So nobody is using setup.py to build SIP extensions? Is there any place
where to send patches, anyhow?
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
More information about the PyQt
mailing list