From owner-freebsd-current Tue Oct 10 12:41:27 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA01479 for current-outgoing; Tue, 10 Oct 1995 12:41:27 -0700 Received: from rocky.sri.MT.net (sri.MT.net [204.94.231.129]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA01474 for ; Tue, 10 Oct 1995 12:41:23 -0700 Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id NAA22092; Tue, 10 Oct 1995 13:43:32 -0600 Date: Tue, 10 Oct 1995 13:43:32 -0600 From: Nate Williams Message-Id: <199510101943.NAA22092@rocky.sri.MT.net> To: "Garrett A. Wollman" Cc: Terry Lambert , ache@astral.msk.su, Kai.Vorma@hut.fi, current@freebsd.org Subject: Re: tail dumps core In-Reply-To: <9510101901.AA10410@halloran-eldar.lcs.mit.edu> References: <9510101735.AA10192@halloran-eldar.lcs.mit.edu> <199510101836.LAA10827@phaeton.artisoft.com> <9510101901.AA10410@halloran-eldar.lcs.mit.edu> Sender: owner-current@freebsd.org Precedence: bulk Garrett A. Wollman writes: > < said: > [ Non-portability of bzero and calloc ] { Code deleted } So, what's your point? Other than some comments in this set of lines > memset(&i, 0, sizeof i); > if (i == 0) { > printf("your machine is normal\n"); > } else { > printf("your machine is really weird, but allowed by the" > " C standard\n"); > } which implies that memset doesn't have to set an integer to all zeros, what's the problem? How does the C standard allow for memseting an int to be non-zero? Also, you made the assertion that calloc() is almost never necessary. I charge you to backup that statement, since I often use structures which I must explicity zero out all of the members, and using calloc() and/or malloc/memset is a big performance win compared to zero'ing out every single member of the struct. Nate