Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!princeton!allegra!alice!bs From: bs@alice.UUCP Newsgroups: comp.lang.c++ Subject: Re: C++ produced symbols & sdb Message-ID: <6761@alice.uUCp> Date: Mon, 30-Mar-87 11:40:15 EST Article-I.D.: alice.6761 Posted: Mon Mar 30 11:40:15 1987 Date-Received: Wed, 1-Apr-87 01:32:32 EST References: <384@sdd.UUCP> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 41 Summary: why cfront mangles names There are two reasons for the mangling of names of (apparently) non-overloaded names. Through derivation a class may have several members of the same name and you and the compiler must have a way of distinguishing them: struct B { int a; int f(); }; struct D : B { int a; int f(int x) { a = x; B::a = x+1; } }; void ff() { D d; d.f(2); d.B::f(); } Names used in inline functions must be ``mangled'' so that the C compiler can distinguish between global names, names local to the inline function, and names local to the calling function: int a; inline f(int a) { return ::a = a++; }; void g() { int a; int b = f(a); } You can strip the mangeling off to make debugging interaction easier (though you loose information), but you cannot strip it off so that the C compiler does not see it without breaking programs.