I have some code for testing that i added upfront the rest of the code, so the rest would never be reached in the test.
Since i have warning level 4 set, this results in an c4702: unreachable-code warning
I tried disabling like this:
//do something
return 0;
/*-------------------------------------------------------------------------*/
#pragma warning(disable: 4702)
//real code
but the compiler still moans. And because i have set to treat every warning as an error, this won’t compile…
I am using Visual Studio 2012 Premium…
Any help would be gladly appreciated.
You maybe just need to place the pragma before the start of the affected function rather than inside it.
From the MSDN docs:
So for example: