473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

enabling unwind semantics

what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc

May 3 '06 #1
27 5892
v4vijayakumar wrote:
what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

Wrong group (comp.lang.c) on two counts, C++ and windows.

Try a VC++ group.

--
Ian Collins.
May 3 '06 #2
v4vijayakumar wrote:
what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc


I can only guess that this means you have disabled exception handling in
your compiler.

May 3 '06 #3
you mean, there can not be a c/c++ compiler in windows, other than
vc++?

May 3 '06 #4
no.

"cl test1.cpp" fails with many errors but "cl /EHsc test1.cpp" compiles
fine.

C:\tmp\cpp>cl test1.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

test1.cpp
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc
:
:
:
C:\tmp\cpp>cl /EHsc test1.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

test1.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.

/out:test1.exe
test1.obj

C:\tmp\cpp>

May 3 '06 #5
v4vijayakumar wrote:
you mean, there can not be a c/c++ compiler in windows, other than
vc++?

Your original post (which you should quote, by the way) showed output
from some microsoft compiler or another, that's why I suggested asking
on one of their groups.

--
Ian Collins.
May 3 '06 #6
v4vijayakumar wrote:
you mean,
Who? Please quote context.
there can not be a c/c++ compiler in windows, other than
vc++?


1. There is no such thing as "C/C++". C and C++ are two distinct languages.
2. Exception handling is C++ specific, since C doesn't support it, so
comp.lang.c has nothing to do with it.
3. Questions about compilers or system specific ones are off-topic in
comp.lang.c++ either, because this group is only about the C++ language
itself, not about any specific tools.

So you should find a newsgroup about your specific compiler (VC++) and ask
the question there.

May 3 '06 #7
> output
from some microsoft compiler

error message itself says it is "Microsoft (R) 32-bit C/C++ Optimizing
Compiler".

May 3 '06 #8
v4vijayakumar wrote:
output


from some microsoft compiler

error message itself says it is "Microsoft (R) 32-bit C/C++ Optimizing
Compiler".

So find an appropriate microsoft group and ask there. That's where the
users of the compiler will be able to help you.

--
Ian Collins.
May 3 '06 #9
Rolf Magnus wrote:
blah blah blah

just wanted to know what "enabling unwind semantics" (may be related to
stack) means.

May 3 '06 #10
v4vijayakumar wrote:
Rolf Magnus wrote:
blah blah blah

just wanted to know what "enabling unwind semantics" (may be related to
stack) means.

Then ask those who might know!

--
Ian Collins.
May 3 '06 #11
v4vijayakumar wrote:
you mean, there can not be a c/c++ compiler in windows, other than
vc++?


Please provide context when replying. See the section about Google in
http://clc-wiki.net/wiki/Intro_to_clc

Your original message clearly indicated you were using MS VC++ hence the
redirection to a group for that compiler when you ask something about
the compiler. The language itself does not define compiler options.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
May 3 '06 #12
v4vijayakumar wrote:
just wanted to know what "enabling unwind semantics" (may be related to
stack) means.


So you should find a newsgroup about your specific compiler (VC++) and ask
the question there.

May 3 '06 #13
v4vijayakumar wrote:
Rolf Magnus wrote:
blah blah blah

just wanted to know what "enabling unwind semantics" (may be related to
stack) means.


So go ask where you might get an answer, as has been suggested.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
May 3 '06 #14
In article <11*********************@u72g2000cwu.googlegroups. com>,
v4vijayakumar <v4***********@yahoo.com> wrote:
outputfrom some microsoft compiler

error message itself says it is "Microsoft (R) 32-bit C/C++ Optimizing
Compiler".


Not in anything you posted in your original question. You said
it was that, you did not quote any *error message* that said it was.

The error message that you -did- quote started with:

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)

which clearly indicates VC++, and hence suggesting that you look
in a VC++ group was exactly appropriate.
If you were to google on "unwind semantics are not enabled"
then you would find your answer easily. In particular, see
http://www.geocities.com/Jeff_Louie/...ms.htm#Warning

Or if you prefer the more authorative saying of the same thing,
http://msdn.microsoft.com/archive/en...asp?frame=true
--
Prototypes are supertypes of their clones. -- maplesoft
May 3 '06 #15
v4vijayakumar wrote:
what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc


Questions about the C++ programming language should never be posted to
<news:comp.lang.c>. Some of the folks at <news:comp.lang.c++> may offer
you an answer, but they are misguided. Questions about
implementation-specific details, such as yours, should go to a
newsgroup, mailing list, or tech support for your implementation.
Microsoft has provided several of these for you, nad there are others
independent of MS. Use them.

<news:comp.lang.c> removed from follow-ups. Perhaps the remaining
newsgroup to which you posted should also be removed: I'll leave that to
others.

May 3 '06 #16
v4vijayakumar wrote:
what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc


The error message says it all...

You are using C++ exceptions in your code, but by default,
support for C++ exceptions is disabled in the compiler.
As directed by the error message, you must add the

/EHsc

compiler option to your compile command line to tell the
compiler to enable support for C++ exceptions.

Larry
May 3 '06 #17
On 3 May 2006 02:35:52 -0700, in comp.lang.c , "v4vijayakumar"
<v4***********@yahoo.com> wrote:
Rolf Magnus wrote:
blah blah blah

just wanted to know what "enabling unwind semantics" (may be related to
stack) means.


Its some feature of your compiler. Did you read the documentation or
search the maker's website?

On second thoughts, why not ask in uk.lang.semantics, then insult
people who suggest you ask in the right place?

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
May 3 '06 #18
* v4vijayakumar:
what "enabling unwind semantics" occording to Microsoft (R) 32-bit
C/C++ Optimizing Compiler.

C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574)
: warnin
g C4530: C++ exception handler used, but unwind semantics are not
enabled. Speci
fy /EHsc


Microsoft's compiler, although one of the most standard-conforming when
you provide appropriate switches, has completely non-standard behavior
/by default/.

By default you have (1) no exception handling, (2) no RTTI, (3) no
wchar_t type, (4) non-standard scope for variables declared in for loops
and while loops, (5) standard 'main' not supported for GUI program.

Check the compiler's command line help info for appropriate switches;
direct further questions to some Microsoft group.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
May 3 '06 #19
By default you have (1) no exception handling, (2) no RTTI, (3) no
wchar_t type, (4) non-standard scope for variables declared in for
loops and while loops, (5) standard 'main' not supported for GUI
program.


can you explain (4)?

is that:
for(int i=1; i; --i);
{
int me=i;
}

now - there's something wrong with 'me'?
May 4 '06 #20
* Gernot Frisch:
By default you have (1) no exception handling, (2) no RTTI, (3) no
wchar_t type, (4) non-standard scope for variables declared in for
loops and while loops, (5) standard 'main' not supported for GUI
program.


can you explain (4)?

is that:
for(int i=1; i; --i);
{
int me=i;
}

now - there's something wrong with 'me'?


for(int i=1; i; --i);
{
}
int me=i;

Here there's "something wrong" with 'me'...

A conforming compiler will not allow that.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
May 4 '06 #21
Alf P. Steinbach wrote:
* Gernot Frisch:
By default you have (1) no exception handling, (2) no RTTI, (3) no
wchar_t type, (4) non-standard scope for variables declared in for
loops and while loops, (5) standard 'main' not supported for GUI
program.

can you explain (4)?

is that:
for(int i=1; i; --i);
{
int me=i;
}

now - there's something wrong with 'me'?

for(int i=1; i; --i);
{
}
int me=i;

Here there's "something wrong" with 'me'...

A conforming compiler will not allow that.

Best to drop comp.lang.c from this thread!

--
Ian Collins.
May 4 '06 #22
for(int i=1; i; --i);
{
}
int me=i;

Here there's "something wrong" with 'me'...

A conforming compiler will not allow that.

Ah. I think VC6 has this "feature". I don't like this. Really annoying
when you write:

for(int i=0;;)
{
}

for (int 0=;;)
{
}

and get an error! How can I turn this off?
May 4 '06 #23
Gernot Frisch wrote:
for(int i=1; i; --i);
{
}
int me=i;

Here there's "something wrong" with 'me'...

A conforming compiler will not allow that.


Ah. I think VC6 has this "feature". I don't like this. Really annoying
when you write:

for(int i=0;;)
{
}

for (int 0=;;)
{
}

and get an error! How can I turn this off?

You can't, VC6 is well known to be broken with respect to variable scope.

Time to upgrade and move on!

--
Ian Collins.
May 4 '06 #24
You can't, VC6 is well known to be broken with respect to variable
scope.

Time to upgrade and move on!


I did, but I have to use it for one project, still (compatibility)
May 4 '06 #25
Gernot Frisch wrote:
You can't, VC6 is well known to be broken with respect to variable
scope.

Time to upgrade and move on!


I did, but I have to use it for one project, still (compatibility)


There's just not much you can do about it. If you need to have code
that is portable between VC6 and others then you have two options:

1. Use a different loop control variable name for each loop that's at
the same level:

for (int Index1 = 0; . . . )
for (int Index2 = 0; . . . )

2. Declare a common loop control variable in the enclosing block:

int Index;

for (Index = 0; . . . )
for (Index = 0; . . . )
Relying on the VC6 bug is a bad idea, as it breaks the code as soon as
you compile it elsewhere. The standard way breaks in VC6.


Brian
May 4 '06 #26
Default User wrote:
Gernot Frisch wrote:
> You can't, VC6 is well known to be broken with respect to variable
> scope.
>
> Time to upgrade and move on!


I did, but I have to use it for one project, still (compatibility)


There's just not much you can do about it. If you need to have code
that is portable between VC6 and others then you have two options:

1. Use a different loop control variable name for each loop that's at
the same level:

for (int Index1 = 0; . . . )
for (int Index2 = 0; . . . )

2. Declare a common loop control variable in the enclosing block:

int Index;

for (Index = 0; . . . )
for (Index = 0; . . . )
Relying on the VC6 bug is a bad idea, as it breaks the code as soon as
you compile it elsewhere. The standard way breaks in VC6.


Well, there was that hack to make the standard way work with it, too. I
think it was something like:

#define for if (false); else for

May 4 '06 #27
Rolf Magnus <ra******@t-online.de> wrote:
Default User wrote:
There's just not much you can do about it. If you need to have code
that is portable between VC6 and others then you have two options:

1. Use a different loop control variable name for each loop that's at
the same level:

for (int Index1 = 0; . . . )
for (int Index2 = 0; . . . )

2. Declare a common loop control variable in the enclosing block:

int Index;

for (Index = 0; . . . )
for (Index = 0; . . . )
Relying on the VC6 bug is a bad idea, as it breaks the code as soon as
you compile it elsewhere. The standard way breaks in VC6.


Well, there was that hack to make the standard way work with it, too. I
think it was something like:

#define for if (false); else for


I believe another workaround was to enclose the entire 'for' loop in its
own block:
// stuff
{
for (int i = 0; . . . ) {
// do stuff in loop
}
}
// i is now out of scope here

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
May 4 '06 #28

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

Similar topics

2
by: Chakkaradeep | last post by:
hi all, as it was discussed earlier in this forum titled,"Execution of Another Application in Services", i got the answer that Services are not meant for executing another applications, but...
2
by: HumptyDumpty | last post by:
Does anyone know if there is a problem with re-enabling the Screen Saver after it has been disabled programmatically. I am using the SystemParametersInfo function within User32.dll, and have...
2
by: rogero | last post by:
I'm having a nasty problem where the destructor of an automatic variable is invoked with the wrong address during stack unwinding. Below is a small example program. Roger Orr -- MVP in C++ at...
14
by: Dan Jacobson | last post by:
How is this for correct HTML 4.01 headers?: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="zh-tw"><head> <meta http-equiv="Content-Type"...
2
by: bluebeta | last post by:
Hi I am using embedded visual C++ and new to it. I have problem when I want to use try/catch. my try/catch code is as below: try { m_oaItem.Add(pItem); SetModifiedFlag();
0
by: v4vijayakumar | last post by:
what "enabling unwind semantics" means occording to Microsoft (R) 32-bit C/C++ Optimizing Compiler. C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574) : warnin g C4530: C++...
1
by: Evan Nelson | last post by:
We are running our website on 3 W2K servers using classic ASP and IIS 5.0. Because the servers are load balanced we don't use the ASP Session object instead we store session type information to the...
35
by: dragoncoder | last post by:
Just a simple theoritical question to the experts. What was the rationale behind making STL containers follow copy semantics rather than reference semantics. References almost always make things...
2
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I would like to define a structure or a class with an array field that behaves like a simple value-semantics variable. For example, I want something like public structure polynomial public a()...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.