Re: How do linkers deal with C++ duplicate code?

Joachim Durchholz <joachim.durchholz@munich.netsurf.de>
25 Aug 1998 13:18:42 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: How do linkers deal with C++ duplicate code? saroj@bear.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? jacob@jacob.remcomp.fr (1998-08-22)
Re: How do linkers deal with C++ duplicate code? ian@cygnus.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? mrs@kithrup.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? mrs@kithrup.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? bowdidge@watson.ibm.com (Robert Bowdidge) (1998-08-24)
Re: How do linkers deal with C++ duplicate code? joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-08-25)
Re: How do linkers deal with C++ duplicate code? dlmoore@molalla.net (David L Moore) (1998-08-30)
Re: How do linkers deal with C++ duplicate code? zalman@netcom.com (1998-08-31)
| List of all articles for this month |

From: Joachim Durchholz <joachim.durchholz@munich.netsurf.de>
Newsgroups: comp.compilers
Date: 25 Aug 1998 13:18:42 -0400
Organization: Compilers Central
References: 98-08-147 98-08-161
Keywords: C++, linker, comment

In comp.compilers John R Levine <johnl@iecc.com> writes:
> >-- Name mangling I understand, ...


ian@cygnus.com wrote:
> As a minor detail, note that C++ name mangling typically only
> describes the input parameter types (which may of course include
> pointers and references; by input types I mean the C++ sense, not the
> logical sense). It does not describe the return type.
>
> That is,
> int foo (int i) {}
> and
> double foo (int i) {}
> will often use the same name for foo. g++ uses foo__Fi for both.


Which is as thing should be. In C++, funcctions must not differ by
return type only.
I'm not sure how this translates to cases where the clash is found only
by the linker, but I'd sure as hell want to avoid this one anyway. It's
just too easy to confuse the two.


Regards,
Joachim
[I'd still think it would be a good idea to make the linker able to
diagnose this error. It's not hard, the DTSS linker did argument type
checking 20 years ago. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.