From owner-freebsd-hackers Wed Mar 6 22:15: 8 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 8372D37B402 for ; Wed, 6 Mar 2002 22:15:06 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.2/8.12.2) with ESMTP id g276EnLv055381; Thu, 7 Mar 2002 07:14:50 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" Cc: drosih@rpi.edu, mwm-dated-1015843484.1eabc5@mired.org, hackers@FreeBSD.ORG Subject: Re: RFC: style(9) isn't explicit about booleans for testing. In-Reply-To: Your message of "Wed, 06 Mar 2002 23:00:59 MST." <20020306.230059.128109706.imp@village.org> Date: Thu, 07 Mar 2002 07:14:49 +0100 Message-ID: <55380.1015481689@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message <20020306.230059.128109706.imp@village.org>, "M. Warner Losh" writes : >: Well, that's my question. David's comment implies that it is not >: good to do '!strcmp()', and I was wondering why it is not good... > > if (strcmp()) > >is the problem with > > if (!strcmp()) > >Which one is right? The first one should mean "are the same" but >really means "are different" and likewise for the second one. Guys, strcmp() has been defined that way for almost 30 years, get used to it, and don't demand obfuscation of every other if() in the kernel to try to hide the fact... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message