Subject: Re: NULL return value checking
To: None <mmondor@gobot.ca>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-kern
Date: 04/23/2002 16:19:03
> Date: Sun, 21 Apr 2002 21:48:23 -0400
> From: Matthew Mondor <mmondor@gobot.ca>
> To: tech-kern@netbsd.org
> Subject: NULL return value checking
> 
> Is there real relevance to checking NULL return values against NULL
> itself, rather than simply using a boolean operation check?

It's a stylistic thing, making the code (arguably) easier to read and
understand.

The (a = b()) =>  ((a = b()) != c) change is a clear indication
that the intent is to assign, not compare.

The comparison with NULL makes it explicit that the value being
compared is a pointer, not an integer.

					- Bill