Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: FREE Message-ID: Date: 1 Mar 90 18:58:40 GMT References: <2714@stl.stc.co.uk> <1990Feb27.155133.20341@druid.uucp> <16055@haddock.ima.isc.com> <1990Mar1.140829.17199@druid.uucp> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 22 In-reply-to: darcy@druid.uucp's message of 1 Mar 90 14:08:29 GMT In article <1990Mar1.140829.17199@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: | In article <16055@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: | >In article <1990Feb27.155133.20341@druid.uucp> darcy@druid.UUCP (D'Arcy J.M. Cain) writes: | >>calloc does what you want and even initialize the space to zeroes for you. | > | >The calloc() function is disrecommended. Generally speaking, you should use | >malloc() and initialize the contents yourself. | > | I've heard that before but not the reason. So why is it disrecommended? Because there exist machines whose floating point 0.0 does not have all bits zeroed. There are also machines where a NULL pointer does not have all bits zeroed. Using calloc will probably work 99.99%, but do you want to have to be the 'lucky' person who has to track down why such a machine gives funny answers. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Catproof is an oxymoron, Childproof is nearly so