Export (0) Print
Expand All
Expand Minimize

Compiler Warning (level 4) C4702

unreachable code

This warning is the result of compiler conformance work that was done for Visual Studio .NET 2003: unreachable code. When the compiler (back end) detects unreachable code, it will generate C4702, a level 4 warning.

For code that is valid in both the Visual Studio .NET 2003 and Visual Studio .NET versions of Visual C++, remove the unreachable code or assure that all source code is reachable by some flow of execution.

See Summary of Compiler-Time Breaking Changes for more information.

// C4702.cpp
// compile with: /W4
#include <stdio.h>
int main()
{
   return 1;
   printf("I won't print.\n");   // C4702 Unreachable
}
Show:
© 2015 Microsoft