From owner-freebsd-chat Mon May 3 23:33:17 1999 Delivered-To: freebsd-chat@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 071441508E; Mon, 3 May 1999 23:32:58 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id PAA09691; Tue, 4 May 1999 15:42:44 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id PAA38267; Tue, 4 May 1999 15:42:26 +0930 (CST) Date: Tue, 4 May 1999 15:42:26 +0930 From: Greg Lehey To: Mike Smith Cc: Nick Hibma , FreeBSD Chat Subject: Hysterical names (was: names of globale variables) Message-ID: <19990504154225.S10134@freebie.lemis.com> References: <199905040143.SAA01330@dingo.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199905040143.SAA01330@dingo.cdrom.com>; from Mike Smith on Mon, May 03, 1999 at 06:43:09PM -0700 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org [following up to -chat] On Monday, 3 May 1999 at 18:43:09 -0700, Mike Smith wrote: >> >> Isn't the choice of the variables names below a bit odd? It crashed my >> machine three times because of a typo (buf instead of buffer) in the >> USB Communications Class Driver. >> >> Wouldn't some more elaborate names be more appropriate to avoid these >> problems? > > "struct buf" is actually a very longstanding BSD tradition. I don't > think we would easily be able to rename it, no. It goes back further than BSD. Here's the definition from a pre-BSD /usr/src/buf.h, probably some of the oldest C code in existence: -rw-r--r-- 1 root wheel 592 Jan 22 1973 buf.h struct buf { int b_flags; struct buf *b_forw; struct buf *b_back; struct buf *av_forw; struct buf *av_back; int b_dev; int b_wcount; char *b_addr; char *b_blkno; } buf[NBUF]; This is the Third Edition of AT&T UNIX (and no, it doesn't have a copyright notice :-). Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message