What's a good term for source code that could theoretically still run, but is purposefully not?

I'm rather thinking of the word unused.

Edit: Unused should be understandable for non technical persons. Other possibilities include unnecessary (you often see this in change logs, as in removed unnecessary lines) or maybe orphaned (although I haven't seen this in a real coding situation. It's rather a translation of a term in my native tongue)


It's called unreachable code.

"Unreachable code" is different from dead code, dead code is code that when executed will result in no change, for example:

x = 5;
/* Dead Code Begin */
x = 6;
x = 5;
/* Dead Code End */

Unreachable code however is code that e.g. in a function that is not referenced anywhere, or code that is after the return clause of a function, this code is present, and theoretically compiled, but can never be "reached" to be executed.

Edit:

Many are claiming that this is not the correct answer and it is not cited anywhere, even though I see wikipedia's distinction is enough, I will quote MISRA C 2012:

Section 8.2 Rule 2.1: A project shall not contain unreachable code

Rationale

Provided that a program does not exhibit any undefined behaviour, unreachable code cannot be executed and cannot have any effect on the program's outputs. The presence of unreachable code may therefore indicate an error in the program's logic.

Then the rule directly after that:

Section 8.2. Rule 2.2: There shall be no dead code

Aplification

Any operation that is executed but whose removal would not affect program behaviour constitutes dead code.

.

.

.

Note: unreachable code is not dead code as it cannot be executed.

And before someone comments that it is saying it is a mistake and not intentional, MISRA exists exactly so that when you break one of its rules you justify why you did that and that it is intentional, otherwise the violation should be removed, but it does not change the definition of what is unreachable and what is dead code.


Since the code is inaccessible, most compilers will eliminate it through Dead Code Elimination, or DCE. So you can refer to it as dead code, or simply dead.

Nullstone's compendium of compiler optimizations defines dead code as

Code that is unreachable or that does not affect the program (e.g. dead stores) [and] can be eliminated.

Since the code is apparently not going to be run, you can also say it is excluded from the build. So, to complete your sentences:

This is excluded code.

I'm going to exclude this code.


RTCA DO-178C - the standard for safety critical code in aircraft - uses the terms "dead code" for code that is never reached in any path through the code. The term "deactivated code" is for code that is deliberately never used in a particular configuration, but could be used in a different mode.