From -6416486990678263899
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-11-27 09:48:01 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: Francis Glassborow <francis.glassborow@ntlworld.com>
Newsgroups: comp.std.c++
Subject: Re: Proposol to increase robustness of programs
Date: Tue, 27 Nov 2001 17:47:06 GMT
Organization: Southfield Microcomputer SS
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <WTC$x4AJu2A8EwrI@robinton.ntlworld.com>
References: <3BFE97B3.91430FB1@wanadoo.fr> <3C02E8F1.4BDAAF29@acm.org>
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
X-Trace: mail2news.demon.co.uk 1006883231 mail2news:28523 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1;format=flowed
User-Agent: Turnpike/6.00-U (<TilyaeicE$WmMOP9F8P4$y3lmP>)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id EAA27597
Lines: 42
Xref: archiver1.google.com comp.std.c++:8318

In article <3C02E8F1.4BDAAF29@acm.org>, Pete Becker <petebecker@acm.org>=20
writes
>Lo=EFc Joly wrote:
>>
>> This works just fine, but now, suppose someone in charge of maintainin=
g
>> the A class discovers that the declaration of f should have been :
>> virtual void f(char const *s);
>> He makes the change, but somehow forget to change class B. The compile=
r
>> will compile silently, but the program will not do the expected thing.
>> This is a real-world example that has already bitten me several times,
>> and is difficult to debug.
>>
>
>You should complain to the person who made that change without
>understanding and documenting its implications. Adding a virtual
>function to a class (whether that's a consequence of adding a new
>function or changing an existing one) is a drastic change, and users of
>the class should be alerted to it.

You mean like the way that the Standard encourages implementors to tell=20
users about adding parameters to functions (thereby changing their=20
signatures, and possibly altering overload resolution when assigning to=20
a pointer to member?  :-)

Unfortunately we live in a far from perfect world. It is a good idea to=20
check that the cars have actually stopped before stepping onto a=20
pedestrian crossing.


--=20
Francis Glassborow
I offer my sympathy and prayers to all those who are suffering
as a result of the events of September 11 2001.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



