Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ulysses!smb From: smb@ulysses.homer.nj.att.com (Steven M. Bellovin) Newsgroups: comp.lang.c++ Subject: Re: "Type-safe" Linkage? Keywords: C++ 2.0 Message-ID: <12328@ulysses.homer.nj.att.com> Date: 27 Oct 89 01:40:25 GMT References: <2118@leah.Albany.Edu> Organization: AT&T Bell Laboratories, Murray Hill Lines: 34 In article <2118@leah.Albany.Edu>, bv3456@leah.albany.edu (Victor @ The Concrete Museum) writes: > > I thought I read somewhere on this group that C++ now has "type-safe" > linkage. Is this so, or was I halucinating? If such a feature exists, > how is it done? Yes, it's true. It's done by name-mangling; if you have a function foo, it will be emitted as something quite ghastly by cfront. For example, cfront translated this: int foo() {return 0;}; int foo(char s) {return s;}; int foo(char s, char t) {return s;}; into this: int foo__Fv (){ return (int )0 ; } int foo__Fc (__0s )char __0s ; { return (int )__0s ; } int foo__FcT1 (__0s , __0t )char __0s ; char __0t ; { return (int )__0s ; } (I've run it through cb to make things vaguely comprehensible.) Makes using a debugger fun, too, though there's an name-demangler program.