none
How to treat error as warning in visual studio RRS feed

  • Question

  • hello,

                     can anybody please tell me how to treat error as warning or block some error in visual studio.

    Thursday, February 13, 2014 7:32 AM

Answers

  • If it is truly an error fix it.  If this is a warning with the /WX option set so it is treated as an error, you can use #pragma warning( disable : ### ) where ### is the error number.

    But be careful if you do this, there is a good reason for these warnings, it is better to fix the code to eliminate them.  I do code review of drivers and have seen developers turn off errors with #pragma's in large groups.  If the code is from a third party vendor I tell my customer to reject it, if it is from an in-house driver developer I suggest the client either tell him to clean up his act, or fire the guy.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, February 13, 2014 12:38 PM

All replies

  • If it is truly an error fix it.  If this is a warning with the /WX option set so it is treated as an error, you can use #pragma warning( disable : ### ) where ### is the error number.

    But be careful if you do this, there is a good reason for these warnings, it is better to fix the code to eliminate them.  I do code review of drivers and have seen developers turn off errors with #pragma's in large groups.  If the code is from a third party vendor I tell my customer to reject it, if it is from an in-house driver developer I suggest the client either tell him to clean up his act, or fire the guy.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, February 13, 2014 12:38 PM