Some constructs in programming languages such as C (and derived) have undefined behavior. The term undefined behavior itself is used by the standard of C. The standard itself often writes as
if ... the behavior is undefined.
In StackOverflow, questions with code having undefined behavior are common and a very common response is one of:
- Undefine behavior
- Because of undefine behavior
- Your code invokes undefine behavior
and such. This question is regarding the last choice. Is it correct to say a statement, or a piece of code invokes undefined behavior? Note that the undefined behavior is a result of false assumptions during code compilation, optimization and generation and is not deliberately produced.
While on the subject, what words can be used instead? Surely a piece of code can have undefined behavior. One might also think of cause or contain.