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


Groups > comp.lang.c > #123347

Re: High level programming in C

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: High level programming in C
Date 2017-11-22 16:08 -0800
Organization None to speak of
Message-ID <lnmv3dsvp8.fsf@kst-u.example.com> (permalink)
References (16 earlier) <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>

Show all headers | 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