Path: utzoo!attcan!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!think!snorkelwacker!mit-eddie!uw-beaver!milton!khan From: khan@milton.acs.washington.edu (I Wish) Newsgroups: comp.lang.c Subject: Re: FREE Summary: calloc() isn't really portable Keywords: calloc, portable, zero Message-ID: <2263@milton.acs.washington.edu> Date: 5 Mar 90 16:47:10 GMT References: <1990Mar1.140829.17199@druid.uucp> <2353@dataio.Data-IO.COM> Reply-To: khan@milton.acs.washington.edu (I Wish) Organization: Barbarian Driving School, University of Washington, Seattle Lines: 22 In article <2353@dataio.Data-IO.COM> bright@Data-IO.COM (Walter Bright) writes: >The reasons are similar to the arguments about not using goto. calloc works >fine and is portable. Whether or not you use it is a religious issue. [...] >And no, I don't care about machines where 0.0 and NULL are not 0 bit >patterns. If someday I should be unfortunate enough to run across one, >I'll worry about it then! Calloc will set up a zero-bit pattern on any machine.... if you are depending on this meaning floating-point zero or the null pointer, then it won't do that some machines, so it can't be called "portable." (As an aside, does a VAX, with floating-point descriptors or whatever it uses, treat zero-bytes as float 0.0?) -- "indecipherable strangers handing out inexplicable humiliation and an unidentified army of horsemen laughing at him in his head ..." -- Douglas Adams Erik Seaberg (khan@milton.u.washington.edu)