Date: Sat, 30 Jun 2001 15:00:05 -0700 (PDT) From: Dima Dorfman <dima@unixfreak.org> To: freebsd-doc@freebsd.org Subject: Re: docs/28555: [PATCH] style(9) isn't explicit about booleans for testing. Message-ID: <200106302200.f5UM05W97431@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: Dima Dorfman <dima@unixfreak.org> To: Mike Meyer <mwm@mired.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 14:57:49 -0700 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. 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. Dima Dorfman dima@unixfreak.org 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?200106302200.f5UM05W97431>