C++0x on name mangling.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jason.cipriani@gmail.com

    C++0x on name mangling.

    Does anybody know if C++0x is going to change C++ name mangling at
    all? Such as, standardizing name mangling instead of leaving it up to
    the compiler?

    Jason
  • James Kanze

    #2
    Re: C++0x on name mangling.

    On Feb 29, 3:44 am, "jason.cipri... @gmail.com"
    <jason.cipri... @gmail.comwrote :
    Does anybody know if C++0x is going to change C++ name
    mangling at all? Such as, standardizing name mangling instead
    of leaving it up to the compiler?
    C++ does not, and in fact, cannot define implementation details.
    There are too many differences at the architecture level to make
    this practical.

    Specific platforms can, and occasionally do, define a platform
    specific C++ API. Regretfully, far too occasionally---there
    isn't one for either Solaris/Sparc nor Windows/PC, and as far as
    I know, only an ad hoc one for Linux/PC. (All platforms I know
    do defined a platform specific API for C.)

    And of course, any time the API differs, you want some sort of
    differing conventions for name mangling, so that you don't
    accidentally link code which won't work together. (I'm not
    aware of any case where the API's are identical, but the name
    mangling isn't. I would consider the name mangling part of the
    API. On the other hand, I wouldn't be surprised if different
    languages---e.g. Pascal and C---under Windows mangled the names
    in the same way, despite using different calling conventions.
    It was, at least, a problem under MS-DOS.)

    --
    James Kanze (GABI Software) email:james.kan ze@gmail.com
    Conseils en informatique orientée objet/
    Beratung in objektorientier ter Datenverarbeitu ng
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

    Comment

    • PeterAPIIT@gmail.com

      #3
      Re: C++0x on name mangling.

      What is name mangling ? No idea what u talking here ?

      Thanks for your explanation

      Comment

      • Lionel B

        #4
        Re: C++0x on name mangling.

        On Fri, 29 Feb 2008 02:31:29 -0800, PeterAPIIT wrote:
        What is name mangling ? No idea what u talking here ?


        --
        Lionel B

        Comment

        • jason.cipriani@gmail.com

          #5
          Re: C++0x on name mangling.

          On Feb 29, 4:31 am, James Kanze <james.ka...@gm ail.comwrote:
          [all kinds of stuff]
          Thanks for the good explanation!
          >On the other hand, I wouldn't be surprised if different
          >languages---e.g. Pascal and C---under Windows mangled the names
          >in the same way, despite using different calling conventions.
          FYI, that problem no longer seems to exist:

          void __stdcall sfunction (int) { }
          void __fastcall ffunction (int) { }
          void __cdecl cfunction (int) { }

          Ends up with:

          00000012 T ?cfunction@@YAX H@Z
          00000007 T ?ffunction@@YIX H@Z
          00000000 T ?sfunction@@YGX H@Z

          Using both MS CL 12.00 (VS 6) and 14.00 (VS 2005).

          Thanks,
          Jason

          Comment

          Working...