Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2002 11:14:12 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Bill Fenner <fenner@research.att.com>, julian@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/dev/usb ohci.c uhci.c
Message-ID:  <Pine.BSF.4.21.0202271112220.97278-100000@InterJet.elischer.org>
In-Reply-To: <200202271904.g1RJ4IO29688@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0202271112220.97278-100000>