[issue4805] Make python code compilable with a C++ compiler

Marc-Andre Lemburg report at bugs.python.org
Mon Jan 5 17:43:59 CET 2009


Marc-Andre Lemburg <mal at egenix.com> added the comment:

On 2009-01-05 13:03, Marc-Andre Lemburg wrote:
> Marc-Andre Lemburg <mal at egenix.com> added the comment:
> 
> On 2009-01-03 04:38, Alexander Belopolsky wrote:
>> Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:
>>
>> On Fri, Jan 2, 2009 at 10:54 AM, Marc-Andre Lemburg
>> <report at bugs.python.org> wrote:
>>> Marc-Andre Lemburg <mal at egenix.com> added the comment:
>>>
>>> Also note that by removing the extern "C" declarations, you not only
>>> changes the exported symbol names of functions, but also those of
>>> exported globals.
>>>
>> What are " exported globals" other than "exported symbol names of
>> functions"?  AFAIK, C++ does not mangle non-function symbols.
> 
> GCC doesn't appear to do so, but there's no guarantee that other
> C++ compilers won't touch these symbols:
> 
> http://en.wikipedia.org/wiki/Name_mangling

Issue #4846 is a good example of a situation where such name mangling
causes problems even for non-function symbols.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4805>
_______________________________________


More information about the Python-bugs-list mailing list