Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #123347

Re: High level programming in C

Path csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: High level programming in C
Date Wed, 22 Nov 2017 16:08:35 -0800
Organization None to speak of
Lines 39
Message-ID <lnmv3dsvp8.fsf@kst-u.example.com> (permalink)
References <ouudfb$jj7$1@dont-email.me> <979bb888-53e1-410b-b013-1ace6c8dc0ad@googlegroups.com> <bd0fe87f-70f2-4e83-8ff4-b6fa83b3b282@googlegroups.com> <ov1b61$b3q$1@dont-email.me> <N3XQB.37994$xh3.19562@fx36.iad> <ov1hic$rus$1@dont-email.me> <1d54853a-79c7-4b7b-8666-51d26cc35b3d@googlegroups.com> <rPoUNWRb65RdvTOR6VscRRzUeKi7@bongo-ra.co> <c6b928d9-561f-4597-822b-d759ce14ae92@googlegroups.com> <ov1lqk$uoo$1@dont-email.me> <eae4c1eb-d14c-404f-8730-4b5e2e3208e1@googlegroups.com> <lnfu97v3ag.fsf@kst-u.example.com> <aeebb39c-0f9f-4852-bc2e-f36b085895e2@googlegroups.com> <ln7eujuzfm.fsf@kst-u.example.com> <1bmv3fz37a.fsf@pfeifferfamily.net> <c78bb494-feb3-9823-1378-a468d2a8e72f@verizon.net> <1bfu96zzof.fsf@pfeifferfamily.net> <7bddbd1b-a738-73e5-cd43-b7d65e4e4310@verizon.net> <ddc0caeb-1f8c-43b4-83d6-9fd0d990f7b1@googlegroups.com> <lnr2sqrlvs.fsf@kst-u.example.com> <88aa44ee-4547-4746-8542-fbc31064f51b@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="e1f3276f3569b23ce5b15c48afdd61b5"; logging-data="7373"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DfRLhVzQXKH//iUzUo0Cs"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:EgbS9Je5b2hT1SXKZv8VYPUFPSU= sha1:DSAAQ8tQgHpwRveatev3aVxOMUU=
Xref csiph.com comp.lang.c:123347

Show key headers only | View raw


supercat@casperkitty.com writes:
> On Wednesday, November 22, 2017 at 4:26:09 PM UTC-6, Keith Thompson wrote:
[...]
>> Certainly an application can treat a null pointer as if it denoted a
>> pointer to an empty string, though I don't think I'd do so myself.
>
> Some libraries do so.  Whether or not one likes such designs, some of
> them are in wide use.

Do you have an example?

[...]

>> Anybody who wants to write a string library that treats null pointers as
>> pointers to empty strings is, of course, free to do so.  If it turned
>> out to be sufficiently useful (which I personally doubt), that would be
>> an argument in favor of making a change to the standard.
>
> I would regard the fact that code written on some platforms did so and
> relied upon such behavior as prima facie evidence that it is useful.

I would regard the fact that that code was *fixed* when it was
ported to a system that behaved differently as evidence that
the maintainers realized the code was buggy in the first place.
Reliance on a null pointer being treated as a pointer to an empty
string was likely inadvertent.

The newer system (SunOS 5 IIRC) *could* have been modified to map
address 0 differently, letting the old buggy code continue to work.
That change would also have made detecting null pointer references in
general more difficult.

[...]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-20 12:14 +0100
  Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-20 12:52 +0100
    Re: High level programming in C Robert Wessel <robertwessel2@yahoo.com> - 2017-11-20 06:07 -0600
      Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-20 13:38 +0100
        Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-20 14:23 +0100
          Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-20 16:56 +0100
          Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-20 17:14 +0000
            Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-20 17:21 +0000
  Re: High level programming in C "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-11-20 22:45 +0800
  Re: High level programming in C Ian Collins <ian-news@hotmail.com> - 2017-11-21 07:30 +1300
    Re: High level programming in C gazelle@shell.xmission.com (Kenny McCormack) - 2017-11-20 18:32 +0000
      Re: High level programming in C jameskuyper@verizon.net - 2017-11-20 11:05 -0800
        Re: High level programming in C Öö Tiib <ootiib@hot.ee> - 2017-11-20 12:59 -0800
          Re: High level programming in C BGB <cr88192@hotmail.com> - 2017-11-22 10:47 -0600
  Re: High level programming in C fir <profesor.fir@gmail.com> - 2017-11-20 13:17 -0800
    Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 03:26 -0800
      Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 14:54 +0100
        Re: High level programming in C scott@slp53.sl.home (Scott Lurndal) - 2017-11-21 14:51 +0000
          Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-21 16:43 +0100
            Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 07:58 -0800
              Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 17:35 +0100
              Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-21 16:38 +0000
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 08:47 -0800
                Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 17:55 +0100
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 09:06 -0800
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 09:13 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-21 11:29 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-21 11:59 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-21 12:52 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-21 13:43 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-21 14:17 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-21 15:00 -0800
                Re: High level programming in C Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-11-21 15:17 -0700
                Re: High level programming in C supercat@casperkitty.com - 2017-11-21 15:09 -0800
                Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 00:55 +0100
                Re: High level programming in C "James R. Kuyper" <jameskuyper@verizon.net> - 2017-11-21 18:58 -0500
                Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 01:19 +0100
                Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-22 01:47 +0000
                Re: High level programming in C Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-11-21 21:48 -0700
                Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-22 07:36 +0000
                Re: High level programming in C "James R. Kuyper" <jameskuyper@verizon.net> - 2017-11-22 12:45 -0500
                Re: High level programming in C supercat@casperkitty.com - 2017-11-22 14:00 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-22 14:25 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-22 15:14 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-22 16:08 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-23 16:42 -0800
                Re: High level programming in C bartc <bc@freeuk.com> - 2017-11-24 01:37 +0000
                Re: High level programming in C supercat@casperkitty.com - 2017-11-24 14:33 -0800
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 16:20 -0800
                Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-22 10:39 +0100
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-23 02:59 -0800
                Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-23 12:24 +0100
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-23 04:49 -0800
                Re: High level programming in C scott@slp53.sl.home (Scott Lurndal) - 2017-11-22 15:42 +0000
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-22 08:57 -0800
                Re: High level programming in C Keith Thompson <kst-u@mib.org> - 2017-11-21 09:19 -0800
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 09:28 -0800
                Re: High level programming in C supercat@casperkitty.com - 2017-11-21 09:22 -0800
            Re: High level programming in C scott@slp53.sl.home (Scott Lurndal) - 2017-11-21 16:29 +0000
              Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 17:43 +0100
          Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 17:40 +0100
            Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 08:52 -0800
              Re: High level programming in C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-11-21 09:28 -0800
                Re: High level programming in C Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 09:34 -0800
        Re: High level programming in C Robert Wessel <robertwessel2@yahoo.com> - 2017-11-21 11:37 -0600
          Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 20:28 +0100
            Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-21 19:45 +0000
              Re: High level programming in C "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-11-21 11:51 -0800
              Re: High level programming in C jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 20:55 +0100
                Re: High level programming in C Spiros Bousbouras <spibou@gmail.com> - 2017-11-21 20:07 +0000
                Re: High level programming in C Ian Collins <ian-news@hotmail.com> - 2017-11-22 09:13 +1300
                Re: High level programming in C scott@slp53.sl.home (Scott Lurndal) - 2017-11-22 15:38 +0000
                Re: High level programming in C Robert Wessel <robertwessel2@yahoo.com> - 2017-11-21 15:17 -0600
                Re: High level programming in C Ian Collins <ian-news@hotmail.com> - 2017-11-22 10:25 +1300
                Re: High level programming in C Robert Wessel <robertwessel2@yahoo.com> - 2017-11-21 15:41 -0600
                Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-22 11:01 +0100
              Re: High level programming in C antispam@math.uni.wroc.pl - 2017-11-21 20:11 +0000
              Re: High level programming in C David Brown <david.brown@hesbynett.no> - 2017-11-22 10:58 +0100

csiph-web