From owner-freebsd-hackers Wed Mar 6 20:29:25 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.22.195.2]) by hub.freebsd.org (Postfix) with ESMTP id E4B5E37B404 for ; Wed, 6 Mar 2002 20:29:21 -0800 (PST) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 16ipWl-0008JO-00 (Debian); Thu, 07 Mar 2002 04:29:15 +0000 Date: Thu, 7 Mar 2002 04:29:15 +0000 From: Tony Finch To: Poul-Henning Kamp Cc: Garance A Drosihn , Mike Meyer , hackers@FreeBSD.ORG Subject: Re: RFC: style(9) isn't explicit about booleans for testing. Message-ID: <20020307042915.D29816@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <26424.1015440592@critter.freebsd.dk> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Poul-Henning Kamp wrote: > >Right, and since the integer is well defined, > if (!strcmp(a, b)) >is perfectly understandable so what is the problem ? If that is ok, then why is p = malloc(sizeof(*p)); if (!p) return ENOMEM; not ok, given that is even more well-defined? I am of the opinion that expressions in a conditional context (i.e. argument of ! && || ?: if while) should be boolean-valued (i.e. either 0 or 1 corresponding to false or true). If they aren't then an appropriate comparison should be done. Tony. -- f.a.n.finch FAEROES SOUTHEAST ICELAND: EASTERLY, BECOMING CYCLONIC THEN WESTERLY, 4 OR 5. SNOW OR SNOW SHOWERS. GOOD OCCASIONALLY POOR. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message