Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 07:14:49 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        "M. Warner Losh" <imp@village.org>
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. 
Message-ID:  <55380.1015481689@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 06 Mar 2002 23:00:59 MST." <20020306.230059.128109706.imp@village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55380.1015481689>