Jump to content
  • Advertisement
Sign in to follow this  
someboddy

Disabling warnings on visual c++ 2008

This topic is 2256 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to do it? Or at least to separate them from the error messages? It's not that I have a problem with warnings(I just ignore them, like any other programmer), but the thing is that usually when my compilation succeeds, I get few warnings(about 10 or 20, sometimes less), but when it fails, each error produces more than 100 warnings, and I have to scan the entire list to find the error(which is the root of the problem).

Share this post


Link to post
Share on other sites
Advertisement
When you look at the error list, there will be three buttons at the top for errors, warnings and messages. Just click the warning button and it will toggle warnings.

Share this post


Link to post
Share on other sites
Quote:

I just ignore them, like any other programmer

Not all programmers ignore warnings. I compile all my programs on the highest warning level, usually with few or no warnings disabled. For example, the project I had open right now only disabled C4800, which is "forcing value to bool 'true' or 'false' (performance warning). It is possible to have no warnings in large programs. Sometimes you may need to disable specific warnings in the overall codebase or disable them in very small sections. Try googling the error number if you want to find out how to fix the code, rather than simply disabling the warning.

Share this post


Link to post
Share on other sites
you can disable them with pragma's, i.e.

#pragma warning(disable:4244)

where the number is the warning to disable. Having said that, warnings are problems with code and you should try to fix the code that causes the warning rather than disabling it. I agree with rip-off on this one. Turn the warning level to max, and fix the code!

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
When you look at the error list, there will be three buttons at the top for errors, warnings and messages. Just click the warning button and it will toggle warnings.


Can't find it:
Free Image Hosting at www.ImageShack.us

Share this post


Link to post
Share on other sites
Quote:
Original post by RobTheBloke
#pragma warning(disable:4244)


It's probably best to push / pop the warning stack :


#pragma warning(push)
#pragma warning(disable:4244)
// do something slightly dodgy, that the compiler would normally complain about
#pragma warning(pop)



Share this post


Link to post
Share on other sites
Quote:
Original post by someboddy
It's not that I have a problem with warnings(I just ignore them, like any other programmer)


I wish my professors felt this way. They always seem to feel the need to take points off for each instance of each warning ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
C4800, which is "forcing value to bool 'true' or 'false' (performance warning).


How would you correctly fix such a warning? My project's full of them, from my Lua binding code.

Share this post


Link to post
Share on other sites

This topic is 2256 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!