Global Information Lookup Global Information

Unreachable code information


In computer programming, 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.[1]

Unreachable code is sometimes also called dead code,[2][3] although dead code may also refer to code that is executed but has no effect on the output of a program.[4]

Unreachable code is generally considered undesirable for several reasons:

  • It uses memory unnecessarily
  • It can cause unnecessary use of the CPU's instruction cache
    • This can also decrease data locality
  • Time and effort may be spent testing, maintaining and documenting code which is never used
    • Sometimes an automated test is the only thing using the code.

However, unreachable code can have some legitimate uses, like providing a library of functions for calling or jumping to manually via a debugger while the program is halted after a breakpoint. This is particularly useful for examining and pretty-printing the internal state of the program. It may make sense to have such code in the shipped product, so that a developer can attach a debugger to a client's running instance.

  1. ^ Debray, Saumya K.; Evans, William; Muth, Robert; De Sutter, Bjorn (1 March 2000). "Compiler techniques for code compaction". ACM Transactions on Programming Languages and Systems. 22 (2): 378–415. CiteSeerX 10.1.1.43.7215. doi:10.1145/349214.349233. S2CID 6129772.
  2. ^ RTCA/DO-178C Software Considerations in Airborne Systems and Equipment Certification. RTCA, Inc. 2011. p. 112. Retrieved 2019-06-11. Dead code – Executable Object Code (or data) which exists as a result of a software development error but cannot be executed (code) or used (data) in any operational configuration of the target computer environment. It is not traceable to a system or software requirement. The following exceptions are often mistakenly categorized as dead code but are necessary for implementation of the requirements/design: embedded identifiers, defensive programming structures to improve robustness, and deactivated code such as unused library functions. [Since requirements-based review should identified such code as untraceable to functional requirements, static code analysis should identify such code as unreachable, and structural coverage analysis of requirements-based testing results should identify such code as unreachable, presence of unjustified dead code in a project should raise consideration of the effectiveness of the organization's development and verification processes.]
  3. ^ Jay Thomas (24 January 2017). "Requirements Traceability Forms the Foundation for Thorough Software Testing". Retrieved 2019-06-11. The combination of requirements traceability with coverage analysis can also turn up areas of "dead code," or code that's never executed. This code can mostly be an inconvenience, but it can also be a security threat if a hacker can gain access and from there gain control. It's code that can't be traced and should therefore be eliminated.
  4. ^ MISRA Consortium (March 2013). MISRA C:2012 Guidelines for the used of C language in critical systems. MIRA Limited. p. 41. Retrieved 2019-06-11. Rule 2.2 there shall be no dead code. Any operation that is executed but whose removal would not affect program behavior constitutes dead code.

and 22 Related for: Unreachable code information

Request time (Page generated in 0.8166 seconds.)

Unreachable code

Last Update:

programming, 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...

Word Count : 1323

Dead code

Last Update:

introduction of side-effects caused by the dead code. Dead-code elimination Redundant code Unreachable code Oxbow code Dead store 0xDEADC0DE is a magic number...

Word Count : 680

Inline function

Last Update:

whether the declaration is before or after the include. To prevent unreachable code from being added to the final executable if all uses of a function...

Word Count : 3153

Internet Control Message Protocol

Last Update:

Where: Type must be set to 18 Code must be set to 0 Address mask should be set to the subnet mask Destination unreachable is generated by the host or its...

Word Count : 2400

Redundant code

Last Update:

previously been calculated and is still available, code that is never executed (known as unreachable code), code which is executed but has no external effect...

Word Count : 409

List of HTTP status codes

Last Update:

(HTTP) response status codes. Status codes are issued by a server in response to a client's request made to the server. It includes codes from IETF Request...

Word Count : 5526

Quarkus

Last Update:

machine binary. GraalVM aggressively removes any unreachable code found within the application's source code as well as any of its dependencies. Combined...

Word Count : 1207

Compiler

Last Update:

of middle end optimizations are removal of useless (dead-code elimination) or unreachable code (reachability analysis), discovery and propagation of constant...

Word Count : 7726

Bottom type

Last Update:

bottom, retrieved 2022-04-13 Understanding null safety - never for unreachable code, retrieved 2022-04-13 Pierce, Benjamin C. (2002). Types and Programming...

Word Count : 996

Oxbow code

Last Update:

to_string(); URL::encode(strInput); fn.result->set_string(strInput.c_str()); } In this, "strHexDigits" is oxbow code (or oxbow data). Dead code Unreachable code...

Word Count : 222

Segmentation fault

Last Update:

performed by the compiler and the exact structure of a code. In this case, the behavior of unreachable code (the return statement) is undefined, so the compiler...

Word Count : 2433

Code cleanup

Last Update:

objects are garbage collected if they are unreachable from the global object. One way to make an object unreachable is to overwrite the variables or properties...

Word Count : 453

DRAKON

Last Update:

(node) of the control flow graph. Consequently, a silhouette can't have unreachable code in any conditions. DRAKON language is used in the German Aerospace...

Word Count : 1990

Defensive programming

Last Update:

TRAFFICLIGHT_GREEN: return "green"; } assert(0); // Assert that this section is unreachable. // Warning: This 'assert' function call will be dropped by an optimizing...

Word Count : 1800

Dead store

Last Update:

store } } The code in the loop repeatedly overwrites the same variable, so it can be reduced to only one call. Dead code Unreachable code "Insecure Compiler...

Word Count : 287

Dynamic software updating

Last Update:

elimination to remove conditionally dead or unreachable code at load or runtime, and recombine the remaining code to minimize its memory footprint or improve...

Word Count : 3570

Memory leak

Last Update:

object is stored in memory but cannot be accessed by the running code (i.e. unreachable memory). A memory leak has symptoms similar to a number of other...

Word Count : 2718

Re2c

Last Update:

about possible deficiencies or bugs, such as undefined control flow, unreachable code, ill-formed escape symbols and potential misuse of the interface primitives...

Word Count : 1447

Unstructured Supplementary Service Data

Last Update:

Supplementary Service Data (USSD), sometimes referred to as "quick codes" or "feature codes", is a communications protocol used by GSM cellular telephones...

Word Count : 1057

Capex Corporation

Last Update:

control flow analysis of the executable code within the COBOL procedure division and identify unreachable code. The Optimizer III version of the product...

Word Count : 2250

NUD

Last Update:

NUD may stand for: En Nahud Airport's IATA airport code Neighbor unreachability detection, a functionality of the Neighbor Discovery Protocol Niue dollar...

Word Count : 62

ICMPv6

Last Update:

after the header described above. For some messages such as destination unreachable or time exceeded there is no defined message body. Others define a use...

Word Count : 880

PDF Search Engine © AllGlobal.net