From owner-cvs-all Thu Apr 4 20:52:23 2002 Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id C797837B419; Thu, 4 Apr 2002 20:52:16 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g354qEi72967; Thu, 4 Apr 2002 21:52:15 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g354qDf84644; Thu, 4 Apr 2002 21:52:14 -0700 (MST) (envelope-from imp@village.org) Date: Thu, 04 Apr 2002 21:51:52 -0700 (MST) Message-Id: <20020404.215152.96920098.imp@village.org> To: mi@aldan.algebra.com Cc: obrien@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/yacc main.c From: "M. Warner Losh" In-Reply-To: <200204050018.g350HvnF007641@aldan.algebra.com> References: <20020404152029.A81900@dragon.nuxi.com> <200204050018.g350HvnF007641@aldan.algebra.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <200204050018.g350HvnF007641@aldan.algebra.com> Mikhail Teterin writes: : On 4 Apr, David O'Brien wrote: : > On Thu, Apr 04, 2002 at 05:43:50PM -0500, Mikhail Teterin wrote: : >> > Use strlen() rather than magic number. : >> [...] : >> : >> Beware of strlen :) The magic number was just a ``sizeof temp_form'' -- : >> computed at the code-writing time. Your change moved the computation to : >> run-time, which, IMHO, is too far. : > : > There is nothing wrong with run-time checks. : : Run-time checks make sense for the stuff that can not be determined at : compile-time. If it can, the run-time check is a useless waste of CPU : time and memory. : : I'm scared of the vision of countless thousands of computers calling : strlen(temp_form) and constantly coming up with the same number -- 16. : Are you not? It doesn't bother me for this case. : > You are also missing the point which is to reduce differences with : > *BSD, not add more. : : I know. But I'm talking to a FreeBSD developer. If the policy for a : change is to convince some other BSD to make it first -- please, say so. For some things yes. And sometimes that just isn't worth the battle. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message