[Bug c++/7740] builtins, and functions marked as extern "C++" with incorrect "C" linkage

joerg dot richter at pdv-fs dot de gcc-bugzilla@gcc.gnu.org
Wed Nov 3 08:20:00 GMT 2004


------- Additional Comments From joerg dot richter at pdv-fs dot de  2004-11-03 08:20 -------
In a recent discussion on comp.lang.c++.moderated was this example to give 
bar "C++" linkage and foo "C" linkage. But g++ gives them both "C" linkage. It 
might be anonther instance of this problem.


extern "C++" {
  typedef void (cpp_func)(int);
}
extern "C" void foo(int a){
   cpp_func bar;
   bar(a);
}

> nm x.o
         U bar
00000000 T foo



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joerg dot richter at pdv-fs
                   |                            |dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7740



More information about the Gcc-bugs mailing list