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

Matthieu Brucher matthieu.brucher at gmail.com
Sat May 17 10:34:01 CEST 2008


Hi,

2008/5/17 Jim Kleckner <jek-gmane at kleckner.net>:

> 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?



This option is only for C++ code, and not for every C++ code. Some people
don't want exception to be handled (take a look at Boost for instance that
let the user decide whether its exception handling is done by the compiler
or by the user), as it can add overhead in some places.
With Scons, the problem is the same, you have to add by hand this flag, and
I think it is the correct way of doing things.

Matthieu
-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20080517/2ba80fe1/attachment.htm>


More information about the Python-Dev mailing list