🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #100

Re: Is the STL too authentic... ?

#100
From: Andrew Koenig
Date: Thu, 05 Oct 1995 23:24
32 lines
1889 bytes
In article <KANZE.95Oct5121708@slsvgqt.lts.sel.alcatel.de> kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:

> The real problem is when it doesn't.  So you read beyond the end of
> the array.  In many cases, particularly those involving built-in
> types, this *won't* core dump.  On the other hand, it is highly
> unlikely that the value you read will give the correct results.

Things aren't quite so simple.

For example, I know a number of people who were involved in
developing the Unix system commands.  When they started using
machines that checked for attempts to read location 0, programs
that had been apparently working for years started crashing.
There had been stray pointer errors in lots of these programs
that turned out in practice to be harmless.

Of course, if the people working on these commands had access to a
checking implementation all along, I would certainly have advocated
that they use it.  But they didn't.

> In such cases, a core dump or a bounds check error might actually be
> preferable.  With bounds checking, the error is guaranteed.  Without,
> you might, and then again, you might not.  There's nothing quite like
> non-reproduceable behavior for programmer job security.

Indeed.

Again, I think implementations that check the rules at run time are
a Good Thing, especialy if you can afford them.  But sometimes you can't.
-- 
				--Andrew Koenig
				  ark@research.att.com
Technical Details
Message-ID: <DG010o.LFK@research.att.com>
Path: arc1-ca.pugleaf.net!in2.uu.net!allegra!alice!ark
References: <5vE-N3F6nTB@site71.ping.at> <DFxJ75.3w0@research.att.com> <KANZE.95Oct5121708@slsvgqt.lts.sel.alcatel.de>

Show Full Headers
Complete Article Headers
Newsgroups: de.comp.lang.c++,comp.lang.c++
Path: arc1-ca.pugleaf.net!in2.uu.net!allegra!alice!ark
From: ark@research.att.com (Andrew Koenig)
Subject: Re: Is the STL too authentic... ?
Message-ID: <DG010o.LFK@research.att.com>
Organization: AT&T Bell Laboratories, Murray Hill NJ
References: <5vE-N3F6nTB@site71.ping.at> <DFxJ75.3w0@research.att.com> <KANZE.95Oct5121708@slsvgqt.lts.sel.alcatel.de>
Date: Thu, 5 Oct 1995 23:24:24 GMT