Earlier quoted context omitted.
If the variable has a null value and the call is invalid then the compiler isn't required to compile it to anything specific; this includes the idea that the compiler isn't required to compile it to a jump-to-address-zero.
> the compiler isn't required to compile it to anything specific That might be true if the ISO C standard were the only source of requirements going into the making of that compiler; it isn't. There are other issues. Obviously, the compiler is in fact compiling it to something very specific . It's not simply an accident due to the situation being ignored that the indirect call gets replaced by a direct jump. The tran…
Since the null pointer option would lead to undefined behavior at runtime (no one is confusing cause and effect here) the compiler can ignore this case.
That leaves only one choice, and that's the result of the compilation.
It can be surprising but it makes sense.