Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Oct 2001 21:20:26 -0800
From:      Luigi Rizzo <rizzo@aciri.org>
To:        "Andrew R. Reiter" <arr@watson.org>
Cc:        Josef Karthauser <joe@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: ipfw.c -- (was: cvs commit: src/sys/netinet ip_fw.h)
Message-ID:  <20011028212026.A94510@iguana.aciri.org>
In-Reply-To: <Pine.NEB.3.96L.1011029000720.32447A-100000@fledge.watson.org>
References:  <200110290441.f9T4fSY68423@freefall.freebsd.org> <Pine.NEB.3.96L.1011029000720.32447A-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 29, 2001 at 12:11:24AM -0500, Andrew R. Reiter wrote:
> 
> Sorry to reply to ipfw.c commits this way, but while there have been style
> fixes, I don't think all have been fixed.  For example, in show_ipfw(),
> there is char timestr[30]; which is found in the middle of an if block.
> IIRC, isn't this a style problem as well?  Also, I would imagine that it's
> just poor design to have to declare variables in the middle of a block,
> whether it be an if-block, for-block, etc..

actually it is _good_ design to declare variables as local as
possible, because it enables the compiler to detect more erroneous
use of the same.

I also fail to understand why style says

    Be careful to not obfuscate the code by initializing variables in the
    declarations.  Use this feature only thoughtfully.  DO NOT use function
    calls in initializers!

as the above seems one of the safest way to make sure that variables
are properly initialized.

	cheers
	luigi
----------------------------------+-----------------------------------------
 Luigi RIZZO, luigi@iet.unipi.it  . ACIRI/ICSI (on leave from Univ. di Pisa)
 http://www.iet.unipi.it/~luigi/  . 1947 Center St, Berkeley CA 94704
 Phone: (510) 666 2927
----------------------------------+-----------------------------------------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011028212026.A94510>