delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/07/31/06:45:12

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <dont_use_email AT nohavenotit DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: _CRT0_FLAG_NULLOK
Date: Wed, 31 Jul 2013 06:30:17 -0400
Organization: Aioe.org NNTP Server
Lines: 51
Message-ID: <op.w020sren0e5s1z@->
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>
NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
User-Agent: Opera Mail/12.16 (Linux)
X-Notice: Filtered by postfilter v. 0.8.2
Bytes: 3027
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Wed, 31 Jul 2013 00:38:16 -0400, Stephen J. Turnbull  
<turnbull AT sk DOT tsukuba DOT ac DOT jp> wrote:

> Georg Potthast writes:
>
>  > I still feel it would be a better "user experience" if atoi() would
>  > not crash. As far as I understand the specification does not
>  > require atoi() to crash if a NULL pointer is passed.
>
> No, it doesn't.  But "not crashing" is not necessarily a better end
> user experience, although it may allow a programmer to save a few
> lines.

...

> It is not possible to give a consistent specification of what
> happens when NULL is passed to a function,

It sure is _possible_.  It just wasn't done.  That's entirely different
than actually *not* being able to specify something.

> [...] because by definition (C standard) there can be no
> valid data pointed to by that pointer.

Non-sequitur.  This does not follow, at all...

Providing a consistent specification for passing a NULL pointer and the
presence or lack thereof of valid data pointed to by a pointer have
*NOTHING WHATSOEVER* to do with each other.  They're 100% independent.

> Therefore any behavior is necessarily arbitrary.

This conclusion is non-sense.

> [...] in accordance with the
> general philosophy of C that it's the programmer's responsibility to
> assure correctness at any level above machine language, [...]

It's the C programmers responsibility to ensure the assembly and machine
language are correct too.  Are you saying an employer is going to hire
someone else to do that?  Non-sense.  You coded it.  You're responsible
for it.  If there is a major bug in the assembly or machine code, it's
definately you who'll get blamed for the error.  So, that's a part of
your job too, whether you like it or not.  Well, the exception is if
you're stupid.  Stupid people ignore doing their job because they can
get away with it for a time, or because they're underpaid, or because
they don't have enough time, or because work is cutting into their
personal life, or because of some other excuse.


Rod Pemberton

- Raw text -


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