468,511 Members | 1,680 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,511 developers. It's quick & easy.

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 5181
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chakkaradeep | last post: by
2 posts views Thread by HumptyDumpty | last post: by
14 posts views Thread by Dan Jacobson | last post: by
reply views Thread by v4vijayakumar | last post: by
35 posts views Thread by dragoncoder | last post: by
2 posts views Thread by =?Utf-8?B?QU1lcmNlcg==?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.