X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" 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: References: <21e77579-1a40-4442-8111-fc976fba78fc 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 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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 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