From owner-cvs-all Wed Feb 21 11:44:49 2001 Delivered-To: cvs-all@freebsd.org Received: from moby.geekhouse.net (moby.geekhouse.net [64.81.6.36]) by hub.freebsd.org (Postfix) with ESMTP id AF75837B491; Wed, 21 Feb 2001 11:44:39 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@dhcp151.geekhouse.net [192.168.1.151]) by moby.geekhouse.net (8.11.0/8.9.3) with ESMTP id f1LJl2c69938; Wed, 21 Feb 2001 11:47:08 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010221141342.A98551@ringworld.oblivion.bg> Date: Wed, 21 Feb 2001 11:44:16 -0800 (PST) From: John Baldwin To: Peter Pentchev Subject: Re: cvs commit: src/share/man/man9 style.9 Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Ben Smithurst Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 21-Feb-01 Peter Pentchev wrote: > On Wed, Feb 21, 2001 at 04:10:19AM -0800, Ben Smithurst wrote: >> ben 2001/02/21 04:10:19 PST >> >> Modified files: >> share/man/man9 style.9 >> Log: >> Don't suggest >> >> if (error = function(a1, a2)) >> >> since it causes a warning with -Wall. Change it so it has an explicit >> test >> against zero, >> >> if ((error = function(a1, a2)) != 0) > > I've sometimes seen tests like: > > if (error = function(a1, a2), error != 0) > > Is this not a bit clearer? Eek!! No, IMHO. If you want them to be separate, then do this: error = function(a1, a2); if (error != 0) Say what you mean. Using the , operator usually just serves to obfuscate things. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message