Even if an invocation is expected to return a value, the invoked subroutine may be buggy and actually does not get to execute a “return” statement. Observe the following example:
In this case, the first “print” statement prints a value of 2 because the “return” statement in the conditional statement executes. However, the second “print” statement is in trouble. This is because the subroutine does not execute any “return” statement. As a result, the question mark remains unresolved in “retinfo”. Technically, the print statement still executes, but what value it prints cannot be determined.
Fortunately, most compilers can catch subroutines that have missing returns.