Subject: Re: a new KNF (and some comments)
To: Simon Burge <simonb@netbsd.org>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 01/21/2000 12:07:49
On Fri, 21 Jan 2000, Simon Burge wrote:

> Jason Thorpe wrote:
> > That should read:
> > 
> > 	if ((error = function(a1, a2)))
> > 
> > but I personally prefer:
> > 
> > 	if ((error = function(a1, a2)) != 0)
> > 
> > ...for additional clarity.
> 
> Doesn't one of the gcc warnings barf about "testing assignment value" or
> something?  I think there are circumstances where you do need the "!= 0"
> bit to keep it happy.

Either one works. Adding the second set of parenthesis makes gcc happy.

Take care,

Bill