Groups | Search | Server Info | Login | Register
Groups > comp.lang.c > #397514
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Small challenge: sort names |
| Date | Sun, 12 Apr 2026 16:15:46 -0700 |
| Organization | None to speak of |
| Lines | 63 |
| Message-ID | <878qar3h3x.fsf@example.invalid> (permalink) |
| 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> <YpzBR.6$rGx6.1@fx24.iad> <20260409001030.000006c9@yahoo.com> <bDBBR.139$Np7d.78@fx15.iad> <86h5pkww9a.fsf@linuxsc.com> <87cy0832zp.fsf@example.invalid> <86o6jo8f30.fsf@linuxsc.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Date | Sun, 12 Apr 2026 23:15:47 +0000 (UTC) |
| Injection-Info | dont-email.me; posting-host="9f62fcc22bc30f56cb1f508c16f333f7"; logging-data="3040164"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+R2nam+PCRGwH3g6pp28Ep" |
| User-Agent | Gnus/5.13 (Gnus v5.13) |
| Cancel-Lock | sha1:XR8vJVf+uYX/4kJLLQXun1Ms5NM= sha1:XylNUUyAwTSd6suqQqMR3aOhkSs= |
| Xref | csiph.com comp.lang.c:397514 |
Show key headers only | View raw
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Tim Rentsch <tr.17687@z991.linuxsc.com> 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.
Do you disagree, or are you just criticizing the way I said 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?
I speculate that no released C implementation gets either !ptr or
2+2 wrong. A bug in the former is, I speculate, more likely than a
bug in the latter, but neither seems likely. If such a bug exists,
my guess is that it's in a pre-standard compiler for some system
that is now obsolete. K&R1 (1978) is less than clear about the
representation of null pointers.
Would you be surprised to see a C compiler that handles !ptr
incorrectly?
I'd be interested in more information about the implementation
that implemented assert() incorrectly.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-07 23:14 -0400
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-08 10:22 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-08 12:25 -0400
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-08 18:57 +0100
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-08 21:04 +0000
Re: Small challenge: sort names Michael S <already5chosen@yahoo.com> - 2026-04-09 00:10 +0300
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-08 23:35 +0000
Re: Small challenge: sort names Michael S <already5chosen@yahoo.com> - 2026-04-09 02:59 +0300
Re: Small challenge: sort names James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-04-09 06:29 -0400
Re: Small challenge: sort names cross@spitfire.i.gajendra.net (Dan Cross) - 2026-04-09 15:15 +0000
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-11 08:49 -0700
Re: Small challenge: sort names cross@spitfire.i.gajendra.net (Dan Cross) - 2026-04-11 19:59 +0000
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-16 18:50 +0200
Re: Small challenge: sort names cross@spitfire.i.gajendra.net (Dan Cross) - 2026-04-16 19:54 +0000
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-17 16:22 +0200
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-08 17:27 -0700
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-08 22:14 -0700
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-09 02:19 -0700
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-09 15:06 +0000
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-12 06:35 -0700
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-12 14:51 +0000
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-13 06:31 -0700
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-12 06:48 -0700
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-12 16:15 -0700
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-25 13:31 -0700
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-25 15:12 -0700
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-26 04:13 +0200
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-25 19:50 -0700
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-26 05:28 +0200
Re: Small challenge: sort names David Brown <david.brown@hesbynett.no> - 2026-04-26 12:08 +0200
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-26 18:16 +0200
Re: Small challenge: sort names David Brown <david.brown@hesbynett.no> - 2026-04-26 19:37 +0200
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-26 17:47 +0000
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-11 08:44 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-08 17:13 -0400
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-11 08:59 +0200
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-11 09:34 +0200
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-11 08:31 +0200
Re: Small challenge: sort names BGB <cr88192@gmail.com> - 2026-04-12 13:08 -0500
What is the point of anything? (Was: Small challenge: sort names) gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-17 20:44 +0000
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-08 18:46 -0700
Re: Small challenge: sort names Sort <Sort@invalid.invalid> - 2026-04-11 19:15 +0100
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-16 18:24 +0200
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-16 18:38 +0100
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-16 19:43 +0200
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-18 11:22 +0100
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-18 17:48 +0200
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-19 08:44 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-22 05:33 -0400
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-22 03:16 -0700
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-22 07:35 -0400
Re: Small challenge: sort names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-23 08:11 -0700
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-23 20:14 +0200
Re: Small challenge: sort names gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-23 18:30 +0000
Re: Small challenge: sort names gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-23 17:19 +0000
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-22 14:11 +0200
Re: Small challenge: sort names James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-04-22 21:27 -0400
[OT][meta] Gender (was Re: Small challenge: sort names) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-23 15:51 +0200
Re: [OT][meta] Gender (was Re: Small challenge: sort names) scott@slp53.sl.home (Scott Lurndal) - 2026-04-23 14:45 +0000
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-23 17:03 +0200
Re: [OT][meta] Gender (was Re: Small challenge: sort names) DFS <nospam@dfs.com> - 2026-04-23 20:31 -0400
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-23 18:43 -0700
Re: [OT][meta] Gender (was Re: Small challenge: sort names) gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-24 16:58 +0000
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Jan van den Broek <balglaas@dds.nl> - 2026-04-24 06:57 +0000
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-24 10:10 +0200
Re: [OT][meta] Gender (was Re: Small challenge: sort names) David Brown <david.brown@hesbynett.no> - 2026-04-24 12:52 +0200
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-23 16:36 -0700
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-24 03:01 +0200
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-23 18:50 -0700
Re: [OT][meta] Gender (was Re: Small challenge: sort names) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-04-24 20:35 -0700
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Michael S <already5chosen@yahoo.com> - 2026-04-24 14:20 +0300
Re: [OT][meta] Gender (was Re: Small challenge: sort names) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-24 14:32 +0200
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-23 20:10 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-25 10:26 -0400
Re: Small challenge: sort names Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-26 13:01 +0200
Re: Small challenge: sort names Rosario19 <Ros@invalid.invalid> - 2026-04-18 11:16 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-18 08:11 -0400
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-18 14:03 +0100
Re: Small challenge: sort names Rosario19 <Ros@invalid.invalid> - 2026-04-20 21:20 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-20 16:43 -0400
Re: Small challenge: sort names Rosario19 <Ros@invalid.invalid> - 2026-04-21 05:09 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-21 08:46 -0400
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-21 16:08 +0100
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-21 11:33 -0400
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-21 18:25 +0100
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-21 17:38 +0000
Re: Small challenge: sort names Michael S <already5chosen@yahoo.com> - 2026-04-21 20:50 +0300
Re: Small challenge: sort names scott@slp53.sl.home (Scott Lurndal) - 2026-04-21 18:22 +0000
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-22 03:48 +0200
Re: Small challenge: sort names David Brown <david.brown@hesbynett.no> - 2026-04-22 09:18 +0200
Re: Small challenge: sort names Michael S <already5chosen@yahoo.com> - 2026-04-22 13:22 +0300
Re: Small challenge: sort names David Brown <david.brown@hesbynett.no> - 2026-04-22 12:38 +0200
Re: Small challenge: sort names Michael S <already5chosen@yahoo.com> - 2026-04-22 13:58 +0300
Re: Small challenge: sort names David Brown <david.brown@hesbynett.no> - 2026-04-22 13:13 +0200
Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-22 14:53 +0200
Re: Small challenge: sort names DFS <nospam@dfs.com> - 2026-04-21 16:31 -0400
Re: Small challenge: sort names Bart <bc@freeuk.com> - 2026-04-21 23:04 +0100
Re: Small challenge: sort names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-20 14:16 -0700
An audience of one (Was: Small challenge: sort names) gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-21 13:00 +0000
Re: An audience of one (Was: Small challenge: sort names) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-04-21 12:21 -0700
Re: Small challenge: sort names Rosario19 <Ros@invalid.invalid> - 2026-04-21 05:00 +0200
Re: Small challenge: sort names Rosario19 <Ros@invalid.invalid> - 2026-04-21 05:06 +0200
Re: Small challenge: sort names gggggggggggunit <gunitinug@50cent.com> - 2026-04-18 10:19 +0000
[OT] Shell approach to Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-19 09:35 +0200
Re: [OT] Shell approach to Re: Small challenge: sort names gazelle@shell.xmission.com (Kenny McCormack) - 2026-04-19 14:18 +0000
Re: [OT] Shell approach to Re: Small challenge: sort names cross@spitfire.i.gajendra.net (Dan Cross) - 2026-04-19 19:32 +0000
Re: [OT] Shell approach to Re: Small challenge: sort names Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-04-22 03:34 +0200
csiph-web