delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/08/01/06:05:05

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
From: "Stephen J. Turnbull" <turnbull AT sk DOT tsukuba DOT ac DOT jp>
To: djgpp AT delorie DOT com
Subject: Re: _CRT0_FLAG_NULLOK
In-Reply-To: <op.w04oetou0e5s1z@->
References: <21e77579-1a40-4442-8111-fc976fba78fc AT googlegroups DOT com>
<b5o37qFldl9U1 AT mid DOT dfncis DOT de>
<f24e8cd3-83ca-4386-a319-a9adb4d74c68 AT googlegroups DOT com>
<3df2f50f-9543-47a7-8e40-a9be82ce5018 AT googlegroups DOT com>
<87fvuvny2v DOT fsf AT uwakimon DOT sk DOT tsukuba DOT ac DOT jp>
<op.w020sren0e5s1z@->
<87ehaeonbp DOT fsf AT uwakimon DOT sk DOT tsukuba DOT ac DOT jp>
<op.w04oetou0e5s1z@->
X-Mailer: VM undefined under 21.5 (beta32) "habanero" b0d40183ac79 XEmacs
Lucid (x86_64-unknown-linux)
Cancel-Lock: sha1:oLdBRrh4WPwP/Mzbhb2GPAOf/Dc=
Date: Thu, 01 Aug 2013 19:04:45 +0900
Message-ID: <87zjt1n2v6.fsf@uwakimon.sk.tsukuba.ac.jp>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Rod Pemberton writes:

 > E.g., [C definition committees] could've specified a NULL pointer
 > always points to an emtpy string of just a null character.  Such a
 > specification is unlikely to break C, since a NULL pointer just
 > needs to have a unique address.  This would've allowed a NULL
 > pointer to safely function as an empty character string too.

Which is an arbitrary decision, because it could be a pointer to an
arbitrary instance of *any* type.  Of course some of those instances
may be compatible with an empty string, but I don't see how you can
guarantee they *all* will be, on all machines you might want to target
with a C compiler.  Even if you restrict them to be "do nothing"
instances.  (Eg, the numeric types have *two* do-nothing instances, 0
and 1, depending on the operation.)  So the decision to favor strings
is arbitrary.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019