Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Small challenge: sort names
Date: Sat, 25 Apr 2026 13:31:49 -0700
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <86se8i3hoq.fsf@linuxsc.com>
References: <10r4h6o$396qn$1@dont-email.me> <10r537m$in2o$4@dont-email.me> <10r5vh2$3mo17$2@dont-email.me> <10r64uq$3pf3r$1@dont-email.me> <20260409001030.000006c9@yahoo.com> <86h5pkww9a.fsf@linuxsc.com> <87cy0832zp.fsf@example.invalid> <86o6jo8f30.fsf@linuxsc.com> <878qar3h3x.fsf@example.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 25 Apr 2026 20:31:51 +0000 (UTC)
Injection-Info: dont-email.me; posting-host="842c0705c388246dee2d3602366a27fb"; logging-data="1206464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zbMJw3iyNbZ9PIYu6wvd1wzosomqFVOI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:mDSRga/2LC4Jc6zDHibU6CnWc28= sha1:y8OEHMxtap3BRYXoHKsTprmcfOw=
Xref: csiph.com comp.lang.c:397944
Keith Thompson writes:
> Tim Rentsch writes:
>
>> Keith Thompson writes:
>>
>>> Tim Rentsch writes:
>>> [...]
>>>
>>>> The semantics of !ptr has been codified to mean 1 for null pointers
>>>> since the original C standard. Heck, even during the 1970s when C
>>>> allowed assigning integers directly to pointers, K&R said that
>>>> assigning 0 to a pointer produces a pointer guaranteed to be
>>>> different than a pointer to any object. Any C implementation where
>>>> !ptr does the wrong thing should be avoided like the plague.
>>>
>>> Any C implementation where !ptr does the wrong thing almost certainly
>>> does not exist. It's difficult to imagine that a C compiler with
>>> such a fundamental bug would ever go out the door.
>>
>> My usual preference is to draw conclusions based on evidence rather
>> imagination or supposition.
>
> Good for you.
>
>>> It's barely possible that compiler that uses a representation other
>>> than all-bits-zero for null pointers might have such a bug, but
>>> (a) anyone creating such an implementation will almost certainly
>>> be extremely careful to get such things right, and (b) I'm not sure
>>> that any such compilers even exist, except perhaps for old systems
>>> that would be considered exotic today.
>>
>> Here again this sounds like just supposition. How much experience
>> do you have, and how extensive, using non-mainstream C compilers?
>> For myself I can't say I much at all, but I have seen one where
>> believe it or not assert() was implemented wrongly. assert()! I
>> certainly wouldn't have guessed that before actually seeing it.
>
> Quick summary: You wrote that "Any C implementation where !ptr does
> the wrong thing should be avoided like the plague." My response
> was, to summarize briefly, that such implementations are unlikely
> to exist and not worth worrying about.
You said "Any C implementation where !ptr does the wrong thing
almost certainly does not exist."
> Do you disagree, or are you just criticizing the way I said it?
I was simply drawing attention to the circumstance of your having
made a statement of fact without offering any facts to support it.
> I believe I was clear about the basis for my statement. No, I don't
> have a lot of experience with non-mainstream C compilers. I'm not
> going to perform a survey of all historical C implementations.
>
> Do you have anything useful to say about my point, as opposed to
> how I expressed it?
As far as I can tell your point is that you don't mind offering
unsupported allegations as facts. In my opinion it is useful
to have that attitude pointed out.