|
Boost : |
From: Nick Ambrose (nick_at_[hidden])
Date: 1999-10-28 16:32:20
Well, I am by no means an expert in this area, but I *thought* decoration
was used to differentiate calling conventions in the linker
and usually meant sometime prepending an _ for certain conventions (pascal
?) and for some conventions, appending the number of bytes of stack space
required for the formal arguments to the function name.
i.e. f(int x, char *y)
might be decorated as
_f_at_4() // since an int and a char * are 4 bytes on our usual VC machine
this could then be mangled by the C++ section of the compiler to be maybe
_f_at_4_int_charstar() // or whatever.
Now, I could be wrong about all of this, or it could happen in the opposite
order, or the schemes could be merged for C++.
I *thought* that decoration wsa introduced in Win16 to account for
stdcall/cdecl calling differences.
Nick
Ed Brey wrote:
> Nick Ambrose wrote:
> >
> > Yeouch. I guess this is (kinda) OK if it really means decoration
> > (which is different than mangling here) and the decorated name
> > is then mangled. I am not sure that is the case though. How
> > many arguments are being passed to the function in question ?
>
> What is the difference between mangling and decoration. I had thought
> that there was just one concept, initially called mangling, and
> renamed by some to decoration. Correct me if I'm wrong, but the
> mangled/decorated name breaks everything down to its most primitive
> type, e.g.
>
> void fn(vector< shared_ptr<int> >&)
>
> becomes (in pseudo-mangled-code)
>
> fn_void_a1_ref_(vector_t2_(shared_ptr_t1_int)_allocator)
>
> The above is just a made-up mangling scheme, with some parentheses
> thrown in to make the prefix notation more readable, but (minus design
> flaws) it uniquely identifies the function and its arguments (and
> return code, which probably isn't necessary). So would this be
> mangling or decorating or neither?
>
> As I recall, then I got the warning, I may not have even been calling
> a function. Rather, I think the cause stemmed from typedefs within
> classes, like vector::iterator, defined within template classes with
> long template argument names and/or long template instantiation names.
>
> ------------------------------------------------------------------------
> Java or juggling?. Everybody learns something at Learn2.com. Where
> you'll find thousands of free 2torials, affordable online courses, and
> useful tips for everyday life. http://clickhere.egroups.com/click/964
>
> eGroups.com home: http://www.egroups.com/group/boost
> http://www.egroups.com - Simplifying group communications
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk