From owner-cvs-all Fri Jul 23 10:47:18 1999 Delivered-To: cvs-all@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id B19B914C04; Fri, 23 Jul 1999 10:47:06 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id DAA07915; Sat, 24 Jul 1999 03:45:47 +1000 Date: Sat, 24 Jul 1999 03:45:47 +1000 From: Bruce Evans Message-Id: <199907231745.DAA07915@godzilla.zeta.org.au> To: gibbs@caspian.plutotech.com, green@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/inetd builtins.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk >>green 1999/07/23 08:49:14 PDT >> >> Modified files: >> usr.sbin/inetd builtins.c >> Log: >> Ahem. Put things back a bit. I declare variables in the scope they're >> used! I don't declare every variable at the top of a function because >> that wastes stack space. I've clarified the error a bit (for if asprintf() >> filas.) > >The stack space usage is usually the same (depends on the compiler), but Good compilers normally optimise for time and allocate enough stack space at the beginning of the function, at least on i386's. This is even required for implementing alloca(). >semantically limiting the scope of the variable to just the area where it >is used is, IMO, advantageous from a maintenance standpoint. Nevertheless, it is explicitly forbidden in style(9) (except in "unusually complicated" routines). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message