• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

...\include\xstring warning

Halli Hallo ...

What does this warning mean and how to solve it?

Thank you very much in advance ...
1>C:\Programme\Microsoft Visual Studio 9.0\VC\include\xstring(2092) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>        C:\Programme\Microsoft Visual Studio 9.0\VC\include\xstring(2083) : while compiling class template member function 'void std::basic_string<_Elem,_Traits,_Ax>::_Copy(unsigned int,unsigned int)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>        C:\Programme\Microsoft Visual Studio 9.0\VC\include\xstring(2221) : see reference to class template instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]

Open in new window

0
chang2008
Asked:
chang2008
  • 3
  • 2
  • 2
2 Solutions
 
evilrixSenior Software Engineer (Avast)Commented:
It means you need you enable stack unwinding in your project because you are using code that throws C++ exceptions.
0
 
evilrixSenior Software Engineer (Avast)Commented:
0
 
AndyAinscowCommented:
Just an aside - you can usually ignore warnings without problems.  It is what it is - a warning that something is not quite correct but might not be a problem in reality.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
evilrixSenior Software Engineer (Avast)Commented:
I wouldn't ignore this specific warning... it you have incorrect stack unwind semantics you'll get unexpected behaviour during an exception (read this something bad).

Also, warnings are there for a reason. Only ignore them if you understand them and know it is safe to do so. In specific cases, use #pragma warning to disable a specific instance, if necessary, to ensure you build without warnings so that if you introduce a new one you'll notice it and investigate.
0
 
chang2008Author Commented:
I have enabled C++ Exceptions and then the warning is gone.

Project property -> C/C++ -> Code Generation -> Enable C++ Exceptions [ set as "Yes(/EHsc) ]

I prefer to have my code without warning and I don't want to ignore it. When the waring is shown, I feel that it means something wrong and can cause a problem in the future. I do agree with evilrix.

Thanks for all comments.
0
 
chang2008Author Commented:
Thank you very much and have a nice day. :)
0
 
AndyAinscowCommented:
I think you (and evilrix) might have misunderstood.
Errors must be fixed.
Warnings must be checked, but they might be ignored if it is safe to do so.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now