News for hackers. Stuff that matters.
Re:Why undefined behavior may call a never-called function by mikeash on Sunday September 24, 2017 @11:49AM (#15325130)
Globals are always initialized. If no initial value is specified, they’re initialized to zero.

What’s undefined here is calling a function pointer that contains zero. Thus the compiler assumes that it must have been set before being called, and since there’s only one value it could possibly be set to, it must be that value.

There are no comments on this comment yet.