Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
lang:cpp:lieur [2019/10/30 16:08] – mhtml -> html root | lang:cpp:lieur [2023/07/28 09:48] (Version actuelle) – [Mangling] : ajout de "Demangler online" root |
---|
| |
[[http://mearie.org/documents/mscmangle/|Microsoft C++ Name Mangling Scheme]] {{ :lang:cpp:lieur:microsoft_c_name_mangling_scheme_mearie.org_documents_2019-10-30_16_04_57_.html |Archive du 20/07/2006 le 30/10/2019}} | [[http://mearie.org/documents/mscmangle/|Microsoft C++ Name Mangling Scheme]] {{ :lang:cpp:lieur:microsoft_c_name_mangling_scheme_mearie.org_documents_2019-10-30_16_04_57_.html |Archive du 20/07/2006 le 30/10/2019}} |
| |
| <blockquote>External functions with the ''%%__%%declspec(dllimport)'' attribute have prefix ''%%__%%imp_'' in all compilers except Borland.</blockquote> |
| |
[[http://www.kegel.com/mangle.html|C++ Name Mangling/Demangling]] {{ :lang:cpp:lieur:c_name_mangling_demangling_2019-10-30_16_05_08_.html |Archive du 30/04/2002 le 30/10/2019}} | [[http://www.kegel.com/mangle.html|C++ Name Mangling/Demangling]] {{ :lang:cpp:lieur:c_name_mangling_demangling_2019-10-30_16_05_08_.html |Archive du 30/04/2002 le 30/10/2019}} |
| |
| * Demangler on-line |
| |
| https://d.fuqu.jp/c++filtjs/ |
| |
| https://demangler.com |
| ===Les méthodes définies dans un entête ont un attribut weak=== |
| Le corps d'une méthode ''template'' doit être identique quelque soit le fichier objet généré. Les méthodes ''template'' étant compilés dans chaque fichier objet (possibilité de nombreux doublons), le compilateur va leur donner l'attribut ''weak''. |
| |
| Si l'implémentation n'est toujours identique, le compilateur va en prendre une au hasard et la généraliser. |
| |
| * Exemple : |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/Entete.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseA.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseB.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseA.cpp}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseB.cpp}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/main.cpp}} |
| |
| * Symboles : |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr_travis/blob/master/cpp/linker/weak/ClasseA.cpp.nm}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr_travis/blob/master/cpp/linker/weak/ClasseB.cpp.nm}} |
| |
| On voit que le symbole ''Entete::go()'' est défini deux fois avec l'attribut weak. Mais le ''#define'' étant différent, les deux implémentations sont différentes. |