Top "Unreachable-code" questions

Unreachable code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program.

Why is this code giving an "unreachable code" error?

I can't seem to find a way to fix this problem. All i'm doing is declaring an integer and it's …

java compiler-errors unreachable-code
Unreachable statement compile error in Java

class For1 { public static void main(String args[]) { int a = 0; for(;;) { break; System.out.println(a); //Line 1 ++a;//Line 2 } } } I …

java unreachable-code
C# Unreachable code detected

I'm getting a "Unreachable code detected" message in Visual Studio at the point i++ in my code below. Can you …

c# unreachable-code
Unreachable code error vs. dead code warning in Java under Eclipse?

Does anyone know why: public void foo() { System.out.println("Hello"); return; System.out.println("World!"); } Would be reported as …

java eclipse dead-code unreachable-code
Unreachable code, but reachable with an exception

This code is part of an application that reads from and writes to an ODBC connected database. It creates a …

c# exception unreachable-code
Emulating GCC's __builtin_unreachable?

I get a whole lot of warnings about switches that only partially covers the range of an enumeration switched over. …

c++ gcc unreachable-code
How to hint to GCC that a line should be unreachable at compile time?

It's common for compilers to provide a switch to warn when code is unreachable. I've also seen macros for some …

c gcc pragma built-in unreachable-code
Why isn't this code unreachable?

I found a case where I have some code that I believe to be unreachable and is not detected. No …

c# .net unreachable-code
Java: How to @SuppressWarnings unreachable code?

Sometimes when you are debugging, you have unreachable code fragment. Is there anyway to suppress the warning?

java suppress-warnings unreachable-code
Unreachable code in for loop increment?

I'm getting a C4702: unreachable code warning in a for loop; the strange thing is that - by breaking apart …

c++ c visual-studio unreachable-code