initializing auto vars (was: Re: initializing null pointers)

ballou at brahms.Berkeley.EDU.UUCP ballou at brahms.Berkeley.EDU.UUCP
Sun Feb 8 11:17:34 AEST 1987


In article <8134 at tekecs.TEK.COM> jans at stalker.UUCP (Jan Steinman) writes:
>The most portable thing to do is NEVER dereference a pointer that has not been
>initialized.  Some micro compilers I've used don't even initialize automatics!

	Do you mean that they do not initialize auto variables for which you
have explicitly supplied initializations?  If so, that is a bug.  If not, why
should the compiler initialize them?  There is no guarantee that they will
be initialized, and it does cost something (in both time and code size) to
do the initialization.  Specifically, if I have a recursive function which
is called fairly often, I certainly don't want to pay the overhead of useless
initialization.
--------
Kenneth R. Ballou			ARPA:  ballou at brahms.berkeley.edu
Department of Mathematics		UUCP:  ...!ucbvax!brahms!ballou
University of California
Berkeley, California  94720



More information about the Comp.lang.c mailing list