Article View: comp.lang.c
Article #253Re: compare literals / if( "cat"== "dog") {}
From: Keith Thompson
Date: Sun, 11 Oct 2026 23:38
Date: Sun, 11 Oct 2026 23:38
24 lines
2159 bytes
2159 bytes
Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
> I don't see fir's posts, so please pardon my replying to fir
> in this manner
>
> On Sun, 11 Oct 2026 18:28:51 +0000, MitchAlsup wrote:
>
>> fir <profesor.fir@gmail.com> posted:
>> -------------------
>>>
>>> if("cat" == "cat") will return true and
>
> Not necessarily. In reference to string literals (the "cat" and "cat" above),
> the C standard notes that "it is unspecified whether these arrays are distinct
> provided their elements have the appropriate values". (ISO/IEC 9899:2024 N3220
> Working Draft, 6.4.5 String literals, point #7).
[...]
I don't believe fir was asserting that it currently works that way in C.
He was asking whether it can be made to work that way. That context
was omitted in the followup.
--
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:
<11ah6ls$329bt$6@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-mailReferences:
<11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org> <11ah4sk$3324o$1@dont-email.me>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 16:38:36 -0700
Organization: None to speak of
Lines: 24
Message-ID: <11ah6ls$329bt$6@kst.eternal-september.org>
References: <11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org>
<11ah4sk$3324o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 11 Oct 2026 23:38:37 +0000 (UTC)
Injection-Info: kst.eternal-september.org;
logging-data="3220861"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ID1p6s4/NbflrRExAYpLo"; posting-host="50698cca2518b68a86663845e71c144a"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:UZtqARKcSEvhLVgGSo/52Z104No= sha256:o/1S3LVZw8S7g/NlKyOHCa26PN7HXtnvbpUJHLlG2Hs=
sha1:GMSW+xSubHvt9La32MXvoffsHEg= sha256:vXQBkaNCT/jbY1H/4QbS2QClc/IYe5oZi+fDGRJDcl0=