From owner-freebsd-current Tue Oct 10 12:02:09 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAB00699 for current-outgoing; Tue, 10 Oct 1995 12:02:09 -0700 Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id MAA00690 for ; Tue, 10 Oct 1995 12:02:06 -0700 Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA10410; Tue, 10 Oct 1995 15:01:35 -0400 Date: Tue, 10 Oct 1995 15:01:35 -0400 From: "Garrett A. Wollman" Message-Id: <9510101901.AA10410@halloran-eldar.lcs.mit.edu> To: Terry Lambert Cc: wollman@lcs.mit.edu (Garrett A. Wollman), ache@astral.msk.su, Kai.Vorma@hut.fi, current@freebsd.org Subject: Re: tail dumps core In-Reply-To: <199510101836.LAA10827@phaeton.artisoft.com> References: <9510101735.AA10192@halloran-eldar.lcs.mit.edu> <199510101836.LAA10827@phaeton.artisoft.com> Sender: owner-current@freebsd.org Precedence: bulk < said: >> 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. #include #include int main(void) { foo *p; double d; int i; memset(&p, 0, sizeof p); if (p == 0) { printf("an all-bits-zero foo * compares equal to NULL\n"); } else { printf("an all-bits-zero foo * compares different to NULL\n): } memset(&d, 0, sizeof d); if (d == 0) { printf("an all-bits-zero double compares equal to 0\n"); } else { printf("an all-bits-zero double compares different to 0\n"); } 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"); } return 0; } -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant