From owner-cvs-all Fri Apr 5 10: 6: 1 2002 Delivered-To: cvs-all@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by hub.freebsd.org (Postfix) with ESMTP id 96B3C37B419; Fri, 5 Apr 2002 10:05:55 -0800 (PST) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.2/8.12.2) with ESMTP id g35I5gYm047043; Fri, 5 Apr 2002 10:05:42 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.2/8.12.2/Submit) id g35I4R5E047030; Fri, 5 Apr 2002 10:04:27 -0800 (PST) Date: Fri, 5 Apr 2002 10:04:27 -0800 From: "David O'Brien" To: Mikhail Teterin Cc: mike@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/yacc main.c Message-ID: <20020405100427.A46969@dragon.nuxi.com> Reply-To: obrien@FreeBSD.org References: <20020405003033.F93859@espresso.q9media.com> <200204051656.g35GuUnF010963@aldan.algebra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200204051656.g35GuUnF010963@aldan.algebra.com>; from mi@aldan.algebra.com on Fri, Apr 05, 2002 at 11:56:30AM -0500 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 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 On Fri, Apr 05, 2002 at 11:56:30AM -0500, Mikhail Teterin wrote: > On 5 Apr, Mike Barcroft wrote: > > David O'Brien writes: > >> On Thu, Apr 04, 2002 at 07:17:57PM -0500, Mikhail Teterin wrote: > >> > 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? > >> > >> You are shitting me aren't you? I could find _thousands_ of such > >> constant results in /usr/src. > > > > Indeed. Code readability always beats unmeasureable performance losses > > hands-down. > > Common, how is sizeof(foo) less (or more) readable than strlen(foo)? DROP IT. OpenBSD and NetBSD uses ``char *foo = "bar";'' We use ``char foo[] = bar";'' due to Mark's pickier lint. I am not going to change that line of our code. BUT the other BSD's cannot use `sizeof' because that will be 4 or 8, which is much less than the ?17? that `sizeof' would be for us. Thus have to use strlen(), and thus we WILL use strlen(). Go buy yourself a gigahertz Athlon (Duron if you're cheap) and find something REAL to worry about. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message