Subject: misc/6714: KNF clarification
To: None <email@example.com>
From: None <firstname.lastname@example.org>
Date: 01/02/1999 02:17:33
>Synopsis: KNF clarification
>Responsible: misc-bug-people (Misc Bug People)
>Arrival-Date: Sat Jan 2 00:20:01 1999
>Originator: Brian Grayson
Parallel and Distributed Systems
Electrical and Computer Engineering
The University of Texas at Austin
>Release: Dec 31 1998
As discussed in August (I've been very remiss in send-pr'ing),
the section about when to use parentheses is absurd.
The improved parenthesizing was provided by John F.
Woods, with a further suggestion by Ted Lemon.
--- /usr/src/share/misc/style.dist Sat Jan 2 02:08:30 1999
+++ /usr/src/share/misc/style Sat Jan 2 02:11:51 1999
@@ -188,9 +188,10 @@
* Unary operators don't require spaces, binary operators do. Don't
* use parenthesis unless they're required for precedence, or the
- * statement is really confusing without them.
+ * statement is really confusing without them, like:
+ * a = b->c + ~d == (e || f) || g && h ? i : j >> 1;
- a = b->c + ~d == (e || f) || g && h ? i : j >> 1;
+ a = ((b->c + ~d == (e || f)) || (g && h)) ? i : (j >> 1);
k = !(l & FLAGS);