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: Sun, 12 Apr 2026 06:35:01 -0700
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <86se908fp6.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>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sun, 12 Apr 2026 13:35:02 +0000 (UTC)
Injection-Info: dont-email.me; posting-host="425f3de481b107cac4c4e410f9a2c2b8"; logging-data="2689433"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2A1oYQdzCWFh1mPUJbnkcIE8ue8EMUL8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:fdUTz0LPyHWcbHHbmnYEL7LCaxg= sha1:MJvXcjmmGS7ae5718QshLrp++gU=
Xref: csiph.com comp.lang.c:397503
scott@slp53.sl.home (Scott Lurndal) 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.
>>
>> 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.
>
> Or even obsolete. The systems in question were all retired by
> 2010, and never had a C compiler. The system was BCD and the
> six digit 'undigit' value of EEEEEE was chosen as the NIL (NULL)
> pointer value.
It would be nice if in the future it were stated directly when a
non-C environment is the context of a comment. I mistakenly
understood that what you were saying had to do with experience
using some unusual C compiler.