Date: Mon, 19 May 1997 23:18:57 -0400 From: "Kevin P. Neal" <kpneal@pobox.com> To: Peter Wemm <peter@spinner.dialix.com> Cc: hackers@FreeBSD.ORG, core@FreeBSD.ORG Subject: Re: Variable initialization Message-ID: <1.5.4.32.19970520031857.0073b7d4@mindspring.com>
next in thread | raw e-mail | index | archive | help
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!"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1.5.4.32.19970520031857.0073b7d4>
