From owner-cvs-all Wed Feb 27 11:20:35 2002 Delivered-To: cvs-all@freebsd.org Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by hub.freebsd.org (Postfix) with ESMTP id 4B1C237B41D; Wed, 27 Feb 2002 11:20:11 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020227192010.WQKW1147.rwcrmhc52.attbi.com@InterJet.elischer.org>; Wed, 27 Feb 2002 19:20:10 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA01302; Wed, 27 Feb 2002 11:14:13 -0800 (PST) Date: Wed, 27 Feb 2002 11:14:12 -0800 (PST) From: Julian Elischer To: Matthew Dillon Cc: Bill Fenner , julian@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/usb ohci.c uhci.c In-Reply-To: <200202271904.g1RJ4IO29688@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 I started by doing that but then it's not immediatly obvious unless you pull the code apart that the NULL will then not be used instead. (it won't but someone might think that it may) anyhow do/while is a valid C construct and exactly does what the code wants.. On Wed, 27 Feb 2002, Matthew Dillon wrote: > I'd just initialize the variable to NULL or 0 or whatever at the top. > I wouldn't go changing loop constructs. > > -Matt > > :maybe a comment may stall that.. > : > :On Wed, 27 Feb 2002, Bill Fenner wrote: > : > :> > :> > 2/ Recode loop to convince gcc that it does initialise a variable > :> > (use do-while instead of for() so gcc knows that we always go through > :> > at least once. Feel free to check my logic. > :> > :> This is why I hate -Werror. Coding for the compiler vs. for readability > :> is always going to end up being a lose. Next year someone will come through > :> here and say "Why isn't this a for() loop? That would make it much more > :> reasable"... > :> > :> Bill > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message