From owner-freebsd-current Tue Oct 10 13:51:44 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA03736 for current-outgoing; Tue, 10 Oct 1995 13:51:44 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA03730 for ; Tue, 10 Oct 1995 13:51:32 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA11036; Tue, 10 Oct 1995 13:47:41 -0700 From: Terry Lambert Message-Id: <199510102047.NAA11036@phaeton.artisoft.com> Subject: Re: tail dumps core To: ache@astral.msk.su (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=) Date: Tue, 10 Oct 1995 13:47:41 -0700 (MST) Cc: terry@lambert.org, wollman@lcs.mit.edu, Kai.Vorma@hut.fi, current@freebsd.org In-Reply-To: from "=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=" at Oct 10, 95 10:56:27 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1270 Sender: owner-current@freebsd.org Precedence: bulk > >> > Why not use 'calloc' instead? bzero isn't portable way. > >> > Theoretically 'calloc' can do some internal optimization of zeroing. > >> > >> Neither of these are portable unless the array being cleared is > >> composed of characters. There is almost never any reason to use > >> calloc(3). > > >I don't understand where you see a non-portability. Can you please > >explain? Thanks. > > > I mean not action (zeroing) but interface used only. > bzero isn't POSIX function. calloc is. Oh, I understand that; I was commenting on the "neither" including the calloc. Garret's point of a double 0 not being a 0 bit value is valid, even though it is really stretching things. I wouldn't expect a double value to be zero if the structure had been zero'ed, futher using a double as a flag value (the only real reason for a pre-zero) is not really good programming because of the overhead involved. You could still do it with a non-explicit cast, though. I don't see how the int/short/long/char atomic integer types aren't correct on all two's complement machines, though (ie: all recent commercially available machines). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.