bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extern "C" { }


From: Bruno Haible
Subject: Re: extern "C" { }
Date: Fri, 24 Oct 2008 13:33:43 +0200
User-agent: KMail/1.5.4

Simon Josefsson wrote:
> Do you know which platforms are affected in this way?

At least glibc systems. with g++ versions from 3.3 to 4.2.

$ cat foo.cc
extern "C" {
#include <complex.h>
}
$ g++ -c foo.cc
...
/usr/include/g++/bits/cpp_type_traits.h:71: error: template with C linkage
/usr/include/g++/bits/cpp_type_traits.h:92: error: template with C linkage
/usr/include/g++/bits/cpp_type_traits.h:226: error: template with C linkage
/usr/include/g++/bits/cpp_type_traits.h:266: error: template with C linkage
/usr/include/g++/bits/cpp_type_traits.h:278: error: template with C linkage
/usr/include/g++/bits/cpp_type_traits.h:290: error: template with C linkage
...

And AIX systems:

$ xlC -c foo.cc
"/usr/ibmcxx/include/complex.h", line 91.25: 1540-089: (S) More than one 
function "abs" has non-C++ linkage.
"/usr/ibmcxx/include/complex.h", line 95.25: 1540-089: (S) More than one 
function "cos" has non-C++ linkage.
...

And OSF/1 systems:

$ cxx -c foo.cc
cxx: Error: /usr/lib/cmplrs/cxx/V6.5-014/include/cxx/complex.hxx, line 139: 
          declaration is incompatible with previous "std::abs" (declared at
          line 200 of "/usr/include/stdlib.h")
    friend double abs(const complex &);
------------------^
cxx: Error: /usr/lib/cmplrs/cxx/V6.5-014/include/cxx/complex.hxx, line 144: 
          declaration is incompatible with previous "std::sin" (declared at
          line 53 of "/usr/lib/cmplrs/cxx/V6.5-014/include/cxx_cname/cmath")
    friend complex sin(const complex &);
-------------------^
...

And IRIX systems:

$ CC -c foo.cc
"/usr/include/CC/stl_relops.h", line 36: error(3205): this declaration may not
          have extern "C" linkage
  template <class T>
  ^

...

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]