Warning C4341 - "XX": Sign value out of range for enumeration constant

When compiling my C ++. Net application, I get 104 warnings like:

Warning C4341 - 'XX': signed value is out of range for enum constant 

Where XX may be

  • Wchar
  • Long
  • Bit
  • Binary
  • GUID
  • ...

I cannot remove these warnings, no matter what I do. When I double-click on them, it takes me to the part of my code that uses OdbcParameters - any, when I try to execute a test project with all the rest of my materials, but not OdbcParameters, it does not give warnings.

Any idea how I can get rid of these warnings? They make real warnings from the code that I really wrote to understand, and it just gives me a terrible feeling that my application has 104 warnings!

+6
c ++ visual-c ++
source share
3 answers

This is a compiler error . Here is another message confirming his known problem. I have the same problem in one of my projects, and there is no way to prevent it from starting unless you have a way to avoid using OdbcParameter. The most conservative way to suppress only buggy warnings is to use

 #pragma warning( push ) #pragma warning( disable: 4341 ) // code affected by bug #pragma warning( pop ) 
+4
source share

In Visual Studio, you can always disable certain warnings by going to:

Project Settings → C / C ++ → Advanced → Disable Special Alerts: 4341

+3
source share

Wait until it runs the compiler code or the #include code that runs it.

[A surefire way of saying that you probably cannot.]

0
source share

All Articles