Indeed, and well put.
...it's only in rare situations that you'll really need this.
Rare?!? Me, I'd say almost all the time.
This may be more poor choices of wording on various people's
parts, or differences in usage of the word "initialize", but...
Statically allocated variables are implicitly initialised to zero,
Which is of course tantamount to initializing them to NULL,
and this is a great idea.
for auto variables it is almost always possible to not use them until
you've set them to a valid (and non-null) value,
"Almost always?" Me, I'd say merely sometimes, and the practice
could still be considered error-prone.
and it is impossible to initialise dynamically allocated memory except
by use of the calloc() function, which is not guaranteed to work as one
might expect for pointers in the first place.
True, which is why one must always explicitly initialize pointers
in dynamically-allocated memory, typically to NULL. (You may
quibble that this isn't strictly "initialization", but then,
neither is what calloc does.)
Initialising pointers to NULL can occasionally be good style, though.
Again, I'd say almost all the time.
I think you, Richard, and I are all in agreement that a
programming style which strives to ensure that all pointer
objects are all either NULL or pointing to valid memory, and
never in the gray, undefined middle, is an excellent idea.
Sometimes the compiler takes care of initializing pointers for
us, and sometimes we have to, but we have to understand all this
if the strategy is to work effectively.