Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102982751
D30507.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
569 B
Referenced Files
None
Subscribers
None
D30507.diff
View Options
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -746,9 +746,10 @@
!(p = f())
.Ed
.Pp
-Do not use
+Do not test without a comparison, or with unary
.Ic \&!
-for tests unless it is a boolean, e.g., use:
+(except for booleans).
+For example, use:
.Bd -literal
if (*p == '\e0')
.Ed
@@ -758,6 +759,16 @@
if (!*p)
.Ed
.Pp
+Prefer:
+.Bd -literal
+if (count != 0)
+.Ed
+.Pp
+over:
+.Bd -literal
+if (count)
+.Ed
+.Pp
Routines returning
.Vt "void *"
should not have their return values cast
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 11:26 AM (22 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14620513
Default Alt Text
D30507.diff (569 B)
Attached To
Mode
D30507: style.9: be explicit about booleans in comparisons
Attached
Detach File
Event Timeline
Log In to Comment