From -7853152378956224353
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-11-26 22:21:03 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!newspeer.clara.net!news.clara.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: Pete Becker <petebecker@acm.org>
Newsgroups: comp.std.c++
Subject: Re: Proposol to increase robustness of programs
Date: Tue, 27 Nov 2001 06:20:40 GMT
Organization: Dinkumware, Ltd
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3C02E8F1.4BDAAF29@acm.org>
References: <3BFE97B3.91430FB1@wanadoo.fr>
X-Trace: mail2news.demon.co.uk 1006842045 mail2news:20544 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
NNTP-Posting-Date: 27 Nov 2001 01:14:00 GMT
X-Accept-Language:  en
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id RAA07400
Lines: 27
Xref: archiver1.google.com comp.std.c++:8310

Lo=EFc Joly wrote:
>=20
> This works just fine, but now, suppose someone in charge of maintaining
> 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 compiler
> 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.
>=20

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.

--=20
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)

---
[ 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                ]



