initializing null pointers

jans at stalker.UUCP jans at stalker.UUCP
Wed Feb 11 02:32:51 AEST 1987


In article <785 at cullvax.UUCP> drw at cullvax.UUCP (Dale Worley) writes:
>jans at stalker.gwd.tek.com (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!
   ^^^^^^^^^^	<--- should have been globals
>
>I would suspect that any optiomizing compiler would try to avoid
>initializing automatics--they're not required to, and it takes time.

Yes, several of you have reminded me of my mistake.  The BDS compiler I used
under CP/M didn't even initialize globals, and at least one or two others
I've used didn't initialize statics -- clearly violating K&R p 198.

:::::: Artificial   Intelligence   Machines   ---   Smalltalk   Project ::::::
:::::: Jan Steinman		Box 1000, MS 60-405	(w)503/685-2956 ::::::
:::::: tektronix!tekecs!jans	Wilsonville, OR 97070	(h)503/657-7703 ::::::



More information about the Comp.lang.c mailing list