Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!ucbcad!ucbvax!cartan!brahms.Berkeley.EDU!ballou From: ballou@brahms.Berkeley.EDU.UUCP Newsgroups: comp.lang.c Subject: initializing auto vars (was: Re: initializing null pointers) Message-ID: <903@cartan.Berkeley.EDU> Date: Sat, 7-Feb-87 20:17:34 EST Article-I.D.: cartan.903 Posted: Sat Feb 7 20:17:34 1987 Date-Received: Mon, 9-Feb-87 01:51:41 EST References: <347@bms-at.UUCP> <7614@utzoo.UUCP> <8134@tekecs.TEK.COM> Sender: daemon@cartan.Berkeley.EDU Reply-To: ballou@brahms.Berkeley.EDU (Kenneth R. Ballou) Organization: Math Dept. UC Berkeley Lines: 16 In article <8134@tekecs.TEK.COM> jans@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@brahms.berkeley.edu Department of Mathematics UUCP: ...!ucbvax!brahms!ballou University of California Berkeley, California 94720