🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2819

Re: C++, Linkage and stabs

#2819
From: Herb Sutter
Date: Tue, 28 Nov 1995 16:09
29 lines
1832 bytes
In article <30BAE46C.2474@sophia.inria.fr>,
   Theodore Papadopoulo <papadop@sophia.inria.fr> wrote:
>First, it seems that I have not understood all of the rationale behind
>mangling scheme... I understand very well why names have to be encoded
>(althougth I do not understand at all why the return type is not a part
>of the encodind scheme). 

Because the return type is not part of a function's signature; for example, 
you can't overload based on return type:

	int  f(int i);
	long f(int i);	// error: redefinition, won't overload

	x = f(15);	// which f()?

So there's no point in mangling in the return type, since the mangled name 
will already be unique without it.  (Note, however, that const _is_ part of 
the signature.)

Herb


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herb Sutter                 2228 Urwin, Ste 102         voice (416) 618-0184
Connected Object Solutions  Oakville ON Canada L6L 2T2    fax (905) 847-6019

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <49f9rr$f5o@steel.interlog.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <30BAE46C.2474@sophia.inria.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: herbs@interlog.com (Herb Sutter)
Newsgroups: comp.std.c++
Subject: Re: C++, Linkage and stabs
Date: 28 Nov 1995 16:09:25 GMT
Organization: Connected Object Solutions (div of Daystar Software Systems Design Inc.)
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <49f9rr$f5o@steel.interlog.com>
References: <30BAE46C.2474@sophia.inria.fr>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: herbs.interlog.com
X-Newsreader: News Xpress Version 1.0 Beta #4
Content-Length: 972
X-Lines: 25
Originator: clamage@taumet