From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Earnshaw To: Nathan Sidwell Cc: rearnsha@sun52.arm.com Subject: Re: suggest parentheses around assignment used as truth value Date: Fri, 03 Jul 1998 06:15:00 -0000 Message-id: <199807030923.KAA25571@sun52.NIS.cambridge> References: <359C95DD.40B0@cs.bris.ac.uk> X-SW-Source: 1998-07/msg00141.html > > It's rather hard to double the parentheses in error, and the form does > visually stand out. > It's very easy to double the parentheses in error. You just have to have the erroneous code inside a macro. Somewhat simple I know, but: #define COMPARE(X,Y) ((X)=(Y)) /* Should be == */ ... if (COMPARE(p,q)) {...} /* Should get a warning, but doesn't */ Richard.