From owner-freebsd-hackers Mon May 19 20:20:58 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA06634 for hackers-outgoing; Mon, 19 May 1997 20:20:58 -0700 (PDT) Received: from brickbat9.mindspring.com (brickbat9.mindspring.com [207.69.200.12]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA06480; Mon, 19 May 1997 20:19:24 -0700 (PDT) Received: from bogus.mindspring.com (user-37kbt95.dialup.mindspring.com [207.69.245.37]) by brickbat9.mindspring.com (8.8.5/8.8.5) with SMTP id XAA21172; Mon, 19 May 1997 23:15:12 -0400 (EDT) Message-Id: <1.5.4.32.19970520031857.0073b7d4@mindspring.com> X-Sender: kpneal@mindspring.com X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 19 May 1997 23:18:57 -0400 To: Peter Wemm From: "Kevin P. Neal" Subject: Re: Variable initialization Cc: hackers@FreeBSD.ORG, core@FreeBSD.ORG Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk At 09:47 PM 5/19/97 +0800, Peter Wemm wrote: >Luigi Rizzo wrote: >> But anyways I was just trying to understand if there was something >> fundamentally wrong in my preference of >> >> int a = 3; >> >> in place of >> >> int a ; >> a = 3 ; > >This doesn't bother me, but the following example does: > >int s = splnet(); >struct inpcb *pcb = sotoinpcb(so); > >[function code] > >This makes life hard for the smp people, becase we will someday have to >change it to something like: (snip) >Anyway, I don't care too much about static initializers, but calling >functions from the initializer list does worry me. Hear hear! Calling functions from initializers is just _wrong_. It's a real pain in the arse when inserting debugging statements into code. Apache does this sometimes, and it's very annoying. If I need to go through the code and put in debug printf()s, I find it irritating to have to change instances of int a = foo(); to be instances of int a; D("Here"); a = foo(); Especially when I find out that, after all of that trouble, the problem lies in brokenness in stat() in AFS. -- XCOMM Kevin P. Neal, Junior, Comp. Sci. - House of Retrocomputing XCOMM mailto:kpneal@pobox.com - http://www.pobox.com/~kpn/ XCOMM kpneal@eos.ncsu.edu Spoken by Keir Finlow-Bates: XCOMM "Good grief, I've just noticed I've typed in a rant. Sorry chaps!"