472,811 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 software developers and data experts.

When Exception handling disabled...

Ele
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::b asic_string<_Elem,_Traits,
_Ax>::size_type,std::basic_string<_Elem,_Traits,_A x>::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>

]

Nov 17 '05 #1
4 5050
Ele wrote:
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
Nov 17 '05 #2
Ele
Carl Daniel [VC++ MVP] <cp*****************************@mvps.org.nospam >
wrote in message news:Oa**************@tk2msftngp13.phx.gbl...
Ele wrote:
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

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?
Nov 17 '05 #3
Ele wrote:
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
Nov 17 '05 #4

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:eg*************@TK2MSFTNGP11.phx.gbl...
Ele wrote:
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.


Or see www.stlport.org

Jeff
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bill Davidson | last post by:
Hi there, Please forgive me for posting this article on multiple groups. Being new in the newsgroups, I was not sure which group would have been appropriate for my question. Sorry. My...
3
by: Master of C++ | last post by:
Hi, I am an absolute newbie to Exception Handling, and I am trying to retrofit exception handling to a LOT of C++ code that I've written earlier. I am just looking for a bare-bones, low-tech...
13
by: kelvSYC | last post by:
What I want to do is to read a 32-bit unsigned integer (let's call that u32) in little-endian form from an fstream. Would it be better if my function went like this: // returns false if an...
4
by: Rob Richardson | last post by:
Greetings! I am working on an application that targets a Pocket PC running Windows CE and SQL Server CE. Almost all functions in the application use a Try block with a Catch block that looks...
8
by: cat | last post by:
I had a long and heated discussion with other developers on my team on when it makes sense to throw an exception and when to use an alternate solution. The .NET documentation recommends that an...
5
by: Joris Zwaenepoel | last post by:
Hi all, I don't think a solution exists, but maybe there is some option in Visual Studio that I do not know about. When developping (or debugging), I like to set the "exceptions" option to...
16
by: NewToCPP | last post by:
I have seen at several places that C++ programmers writing for RealTime Embedded applications dont use Exception Handling. They dont like Throw/catch concept. WHY? Thanks.
2
by: jayapal | last post by:
Hi , I am using the NEW operator to allocate the memory in many places of my code.But I am not doing any error hadling or exception handling.Can any one suggests me how to do exception handling,...
9
by: =?Utf-8?B?UmFq?= | last post by:
How do I know which methods will throw exception when I am using FCL or other third party .Net library? I am developer of mostly native Windows applications and now .Net. After working few...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.