From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Currie To: richard.earnshaw@arm.com Cc: Andreas Schwab , Marc Rouaix , egcs@cygnus.com, rearnsha@sun52.arm.com Subject: Re: suggest parentheses around assignment used as truth value Date: Wed, 01 Jul 1998 21:20:00 -0000 Message-id: <359B0985.2FB4@tssc.co.nz> References: <199807011520.QAA13670@sun52.NIS.cambridge> X-SW-Source: 1998-07/msg00063.html Richard Earnshaw wrote: > if ((x = p()) != 0) {...} > > Then it becomes clear why the extra parentheses are needed. Yes, because without the parentheses, it will be evaluated as: if (x = (p() != 0)) {...} And you're right back where you started from with a `suggest parentheses around assignment used as truth value' warning. Bill -- Leave others their otherness