473,748 Members | 7,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\includ e\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\includ e\xstring(1444) : while compiling class-template member
function 'void
std::basic_stri ng<_Elem,_Trait s,_Ax>::_Copy(s td::basic_strin g<_Elem,_Traits ,
_Ax>::size_type ,std::basic_str ing<_Elem,_Trai ts,_Ax>::size_t ype)'

with

[

_Elem=char,

_Traits=std::ch ar_traits<char> ,

_Ax=std::alloca tor<char>

]

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\stdexcept(39) : see reference to class template
instantiation 'std::basic_str ing<_Elem,_Trai ts,_Ax>' being compiled

with

[

_Elem=char,

_Traits=std::ch ar_traits<char> ,

_Ax=std::alloca tor<char>

]

Nov 17 '05 #1
4 5134
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.nos pam>
wrote in message news:Oa******** ******@tk2msftn gp13.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.nos pam>
wrote in message news:eg******** *****@TK2MSFTNG P11.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
3170
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 Question ----------- I am looking for a list of popular compilers and/or platforms that *do not* support native C++ exceptions. Any pointers in this
3
2750
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 exception handling mechanism which will allow me to pass character information about an error and its location from lower-level classes. Can you please critique the following exception handling mechanism in terms of my requirements ?
13
1681
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 error occurs reading the value bool read(std::fstream& stream, u32& value); or this: u32 read(std::fstream& stream) throw(FileReadingException);
4
2040
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 like this: Try TryToDoIt() Catch e as Exception LogTheError(e)
8
2258
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 exception should be thrown only in exceptional situations. It turned out that each of my colleagues had their own interpretation about what an "exceptional situation" may actually be. First of all, myself I’m against using exceptions extensively,...
5
1490
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 "break when the error is thrown", even for handled exceptions, because a general purpose error handler usually handles all unexpected exceptions. A side effect of that is that a break also happens when an exception occurs
16
6939
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
4044
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, which code part I have to add to do the exception handling Thanks in advance, ..
9
1930
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 months in Java, I am thinking why Win32 APIs or even .Net documentation not clear on which methods will throw exception or what exceptions can be expected. Jave APIs clearly define exceptions that can be expected and enforces that we handle them. ...
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.