When Exception handling disabled compiler still spits out "C++ exception
handler used." Why is that?
Why does it ask for "Specify /EHsc"?
Thanks!
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(1453)
: warning C4530: C++ exception handler used, but unwind semantics are not
enabled. Specify /EHsc
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(1444) : while compiling class-template member
function 'void
std::basic_string<_Elem,_Traits,_Ax>::_Copy(std::basic_string<_Elem,_Traits,
_Ax>::size_type,std::basic_string<_Elem,_Traits,_Ax>::size_type)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\stdexcept(39) : see reference to class template
instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
Carl Daniel [VC++ MVP] - 14 Jun 2004 05:31 GMT
> When Exception handling disabled compiler still spits out "C++
> exception handler used." Why is that?
>
> Why does it ask for "Specify /EHsc"?
It's telling you that you're trying to compile code that requires exception
handling with exception handling disabled. Either change the code (in this
case, it's the standard library, so you can't really do that), or enable
exception handling.
-cd
Ele - 15 Jun 2004 18:17 GMT
> > When Exception handling disabled compiler still spits out "C++
> > exception handler used." Why is that?
[quoted text clipped - 7 lines]
>
> -cd
Thanks Carl.
By specifying "/EHsc", the compile error gone. So, in this case, what
"/EHsc" switch does here to solve the problem? Is it enabling exception
handling? What if exception handling has to be disabled and we have to use
the standard library, what shall we do then?
Carl Daniel [VC++ MVP] - 15 Jun 2004 19:19 GMT
> By specifying "/EHsc", the compile error gone. So, in this case, what
> "/EHsc" switch does here to solve the problem? Is it enabling
> exception handling?
Yes.
> What if exception handling has to be disabled and
> we have to use the standard library, what shall we do then?
You cannot use the standard library without exceptions. You can, however,
use a library a lot like the standard library without exceptions. I believe
that Dinkumware's Unabridged Library (see
http://www.dinkumware.com/libdual_vc.html) can be used with exceptions
disabled.
-cd
Jeff F - 15 Jun 2004 20:51 GMT
> > By specifying "/EHsc", the compile error gone. So, in this case, what
> > "/EHsc" switch does here to solve the problem? Is it enabling
[quoted text clipped - 10 lines]
> http://www.dinkumware.com/libdual_vc.html) can be used with exceptions
> disabled.
Or see www.stlport.org
Jeff