News for hackers. Stuff that matters.
Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by jcelerier on Friday January 24, 2020 @11:31AM (#22139706)
how is that related in any way to the article ?
Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by Someone on Friday January 24, 2020 @11:47AM (#22139920)
Also, I don’t think there is anything in the C, respectively C++ standards that forbids, respectively requires name mangling. Linking isn’t specified in either standard.

C++ implementations have name mangling because they live on systems designed for C, which don’t allow symbols such as int max(int,int)

C implementations (would) need name mangling if they ran on a system that used case-insensitive comparisons on symbol names, or on ones whose character set is smaller than that allowed in C symbols (I know examples of neither, but Wikipedia has an example that encodes the calling convention in the symbol name: https://en.wikipedia.org/wiki/Name_mangling#C)

Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by ape4 on Friday January 24, 2020 @12:23PM (#22140353)
The table in that article shows how different compilers mange very similarly but not the same! This is something that could be standardized for the benefit of all.
Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by Someone on Friday January 24, 2020 @02:07PM (#22141388)
Not quite. You would know what to call, but not how to call it. That would require full ABI compatibility, and C++’s is complex. https://isocpp.org/wiki/faq/compiler-dependencies#binary-com...:

”If name mangling was standardized, could I link code compiled with compilers from different compiler vendors?

Short answer: Probably not.”

(click link for more info)

Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by jcelerier on Friday January 24, 2020 @03:30PM (#22142149)
> Probably not.

yet the real life answer is that I can link C++ code built with three different compiler on linux (gcc / clang / icc) and three / two on windows (clang / cl.exe / icc or clang / gcc)

Re:The C++ Lifetime Profile: How It Plans to Make C++ Code S... by ape4 on Friday January 24, 2020 @02:46PM (#22141778)
Thanks for the info. I'm just a C/C++ user. There has to be way to workout a convention for all those options.