🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #247

Re: compare literals / if( "cat"== "dog") {}

#247
From: Keith Thompson
Date: Sun, 11 Oct 2026 22:50
21 lines
1840 bytes
MitchAlsup <user5857@newsgrouper.org.invalid> writes:
[...]
> One can also add:
>
> # define areEQUAL   == 0
> # define areINEQUAL != 0
> # define areLESS    < 0
> # define areGREATER > 0
>
> So you can write:
>
>      if( strcmp( "cat", "dog" ) areEQUAL )

There's a proposal to add streq() to C2y, so streq(a, b) is equivalent
to (strcmp(a, b) == 0).  I find that clearer than your areEQUAL macro.

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3567.pdf

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID: <11ah3sj$329bt$3@kst.eternal-september.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail
References: <11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org> <1791747021-5857@newsgrouper.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: compare literals / if( "cat"== "dog") {}
Date: Sun, 11 Oct 2026 15:50:59 -0700
Organization: None to speak of
Lines: 21
Message-ID: <11ah3sj$329bt$3@kst.eternal-september.org>
References: <11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org>
	<1791747021-5857@newsgrouper.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 11 Oct 2026 22:51:00 +0000 (UTC)
Injection-Info: kst.eternal-september.org;
	logging-data="3220861"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19KMqMi34/KL3p1P0vwh3Qh"; posting-host="50698cca2518b68a86663845e71c144a"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:ECaCwClxgZFhS5RGzBuSxJItUcU= sha256:vyJoeX6PLtjrza5Nx/W87B2WVGQjJszKPXjLSxZJQX4=
	sha1:nVSqV4kAGVFgCqHYVLMqNxqZUBs= sha256:7aP/Dn2i93aZ/q9+p46pkbjK6TXEsREOh3qDku6vzhM=