[Python-Dev] Visual Studio 2008 compiler option EHsc ?

Jim Kleckner jek-gmane at kleckner.net
Sat May 17 01:16:43 CEST 2008


Martin v. Löwis wrote:
>> In building a package with several platforms, I
>> ran across the warning message below from Visual
>> Studio 2008.  Should we add the /EHsc option to the
>> compile_options in distutils for MSVC?  Or is it more
>> complex than that...
> 
> Who is "we"? If you have a module that uses C++ exceptions,
> you should certainly enable compiler support for exceptions,
> for that module.

In my original email, I referred to the patch for distutils at:
  http://tinyurl.com/63bqo2

Based on that patch, I made the attached patch in distutils to
msvc9compiler.py and that made the complaints disappear
(and presumably made the exceptions work?).

Is there any downside to doing this by default?
Or should I parameterize my build_ext for that platform
to include that option?

Some of the web pages on the topic suggest that this is
due to a change in the compiler behavior with VS2008.
So this may bite other people as 2.6 rolls out.

I am not an expert in structured exception handling
and all the nuances so welcome any advice.

Thanks - Jim



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://mail.python.org/pipermail/python-dev/attachments/20080516/13b66cde/attachment.txt>


More information about the Python-Dev mailing list