Y) { return X + Y; int Z = X * Y; } the definition is never reached as the function always returns before it. Therefore, the need be neither allocated storage nor initialized. goto fail bug Apple's SSL/TLS from February 2014 contained a major security flaw known formally as and informally as the "goto fail bug". The relevant code fragment is: static OSStatus SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams, uint8_t *signature, UInt16 signatureLen) { OSStatus err; ... if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) goto fail; ... fail: SSLFreeBuffer(&signedHashes); SSLFreeBuffer(&hashCtx); return err; } Here, there are two successive calls to goto fail. In the syntax of the C language, the second is unconditional, and hence always skips the call to SSLHashSHA1.final. As a consequence, err will hold the status of the SHA1 update operation, and signature verification will never fail. Here, the unreachable code is the call to the final function. Applying the Clang compiler with the option -Weverything includes unreachable code analysis, which would trigger an alarm for this code. C++ In C++, some constructs are specified to have undefined behavior. A compiler is free to implement any behavior or none, and typically an optimizing compiler will assume the code is unreachable. Analysis Detection of unreachable code is a form of control flow analysis to find code that can never be reached in any possible program state. In some languages (e.g. Java) some forms of unreachable code are explicitly disallowed. The optimization that removes unreachable code is known as dead code elimination. Code may become unreachable as a consequence of transformations performed by an optimizing compiler (e.g., common subexpression elimination). In practice the sophistication of the analysis has a significant impact on the amount of unreachable code that is detected. For example, constant folding and simple flow analysis shows that the inside of the if-statement in the following code is unreachable: int N = 2 + 1; if (N == 4) { /* unreachable */ } However, a great deal more sophistication is needed to work out that the corresponding block is unreachable in the following code: double X = sqrt(2); if (X > 5) { /* unreachable */ } Unreachable code elimination technique is in the same class of optimizations as dead code elimination and redundant code