Path: utzoo!attcan!uunet!husc6!mit-eddie!inria.inria.fr!shapiro From: shapiro@inria.inria.fr (Marc Shapiro) Newsgroups: comp.lang.c++ Subject: Warning: implicit type conversions make debugging very hard. Message-ID: <8807181344.AA04190@blueberry.inria.fr> Date: 19 Jul 88 00:49:21 GMT Sender: daemon@eddie.MIT.EDU Organization: INRIA, BP 105, 78153 Le Chesnay Cedex, France telephone +33(1)39-63-55-11, telex 697033 F, telecopy +33(1)39-63-53-30 Lines: 26 Implicit type conversions are a very nice feature of C++. However, since they happen under the covers, they can really mess you up. We just had the case where we changed the interface to a certain member function. By mistake, one of it uses was incorrectly left with the old interface. But, the compiler didn't complain, because there is an obscure conversion operation between the two types. Admittedly, like all features, type conversion should be handled with care. Admittedly, it is a very useful one. But in some sense it defeats the purpose of strong type-checking. Ours is a large project with many different people, so this kind of error is bound to happen eventually. Debugging this kind of case can be very hard. In this case, since we are using cfront, a glance at the intermediate ..c file allowed us to find the problem rather easily. Native-code compiler writers should think about this. There is a need for some kind of debugging traces for all the wierd things C++ can do under the covers, e.g. overloading, conversion between objects and references, implicit arguments, or overloading. Marc Shapiro INRIA, B.P. 105, 78153 Le Chesnay Cedex, France. Tel.: +33 (1) 39-63-53-25 e-mail: shapiro@inria.inria.fr or: ...!mcvax!inria!shapiro