Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2002 21:01:50 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Juli Mallett <jmallett@FreeBSD.org>
Cc:        Tony Finch <fanf@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/usr.bin/uudecode uudecode.c
Message-ID:  <20020911205548.E1092-100000@gamplex.bde.org>
In-Reply-To: <20020910145812.B78992@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 10 Sep 2002, Juli Mallett wrote:

> * De: Tony Finch <fanf@FreeBSD.org> [ Data: 2002-09-10 ]
> >   ...
> >   Log:
> >   Style: Don't treat pointers as booleans.
>
> Do we have a firm style(9) ruling on that?  There's like two cases I know
> of where it's justified, both are code that return pointers, and use 0 / false
> internally.  I loathe if(ptr) almost as much as if(foo &bitmask) and if(!strcmp)

What's wrong with "if(foo &bitmask)" (except for its whitespace of course)?
It is a multi-boolean test if bitmask is essentially an array of booleans.
It seems to be Normal KNF too.  But !(foo & bitmask) seems to be abNormal --
(foo & bitmask) == 0 seems to be normal.

Bruce


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?20020911205548.E1092-100000>