Date: Sat, 30 Jun 2001 16:00:14 -0700 (PDT) From: Mike Meyer <mwm@mired.org> To: freebsd-doc@freebsd.org Subject: Re: docs/28555: [PATCH] style(9) isn't explicit about booleans for testing. Message-ID: <200106302300.f5UN0EA27618@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/28555; it has been noted by GNATS. From: Mike Meyer <mwm@mired.org> To: Dima Dorfman <dima@unixfreak.org> Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: docs/28555: [PATCH] style(9) isn't explicit about booleans for testing. Date: Sat, 30 Jun 2001 17:55:10 -0500 Dima Dorfman <dima@unixfreak.org> types: > Mike Meyer <mwm@mired.org> writes: > > > > >Number: 28555 > > >Category: docs > > >Synopsis: [PATCH] style(9) isn't explicit about booleans for testing. > > >Description: > > > > The style(9) page says not to use ! for testing values unless the > > value is a boolean. It also says to test pointers against NULL. This > > leaves open the question of how other values that aren't booleans > > should be tested. > > > > >How-To-Repeat: > > > > Read the man page to try and decide if you should write "if (x)" or > > if (x != 0). > I think it is quite clear on the subject. If it's not a boolean, > don't treat it like one; i.e., compare it against the value you're > looking for. '0' may not always be that value. I did overstated the case in the description. I agree that it's clear on the subject; I think it needs to be made explicit. > Regardless, this does not belong as a PR, let alone in the docs/ > category. It belongs as a post on -hackers, asking what people think, > not as a change request. Since *developers* are expected to follow > style(9), it is the *developers* (i.e., -hackers@) that you should be > proposing the change to. We both agree I'm not proposing a change in the style they have to follow; I'm just proposing making something explicit instead of implicit. As such, I'm not sure it warrants discussion. If the PR belongs in another category, please feel free to move it to either move it or suggest one for someone else to move it to. Thanx, <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106302300.f5UN0EA27618>