Take the 2-minute tour ×  I'm getting a compile-time error. It
complains that I'm initializing a variable, but not referencing
it. What's happening is that I initialize it then make a debug
print statement that only get's compiled in for a debug build
but not a release build. The error in question is warning c4189
(it's treated as an error and won't compile).  Is it possible to
suppress this warning? How about warnings in general?
share|improve this question You shall try to understand the
warning and make warning free code instead of suppressing it. – 
billz Nov 1 '12 at 23:36 Why not put the variable declaration
inside the debug-only part as well? –  Kerrek SB Nov 1 '12 at
23:36 If you really want to, there's a #pragma to 'fix'
warnings. On the whole, though, you should fix the code, not use
the #pragma. –  Jonathan Leffler Nov 1 '12 at 23:38 You can just
click on the warnings tab (if you're using mvs) to hide the
warnings. It should still compile. –  user1534664 Nov 1 '12 at
23:42 add comment  1 Answer  u