Disabling warnings on visual c++ 2008

Started by
16 comments, last by Cornstalks 11 years, 11 months ago
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).
-----------------------------------------Everyboddy need someboddy!
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.
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.
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!
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
-----------------------------------------Everyboddy need someboddy!
view -> other windows -> error list.
Oh. Thanks dude.
-----------------------------------------Everyboddy need someboddy!
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)


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 ;)

Check out the first gameplay video from my javascript/PHP RTS game
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.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

This topic is closed to new replies.

Advertisement