Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflicting declaration of '__pid_t gettid()' with 'C' linkage #267

Open
ewirch opened this issue Dec 20, 2019 · 1 comment
Open

conflicting declaration of '__pid_t gettid()' with 'C' linkage #267

ewirch opened this issue Dec 20, 2019 · 1 comment

Comments

@ewirch
Copy link

ewirch commented Dec 20, 2019

/usr/include/bits/unistd_ext.h:34:16: error: conflicting declaration of '__pid_t gettid()' with 'C' linkage
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
In file included from honest-profiler/src/main/cpp/thread_map.cpp:1:
honest-profiler/src/main/cpp/thread_map.h:14:5: note: previous declaration with 'C++' linkage
   14 | int gettid();
      |     ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from honest-profiler/src/main/cpp/thread_map.cpp:4:
/usr/include/bits/unistd_ext.h:34:16: error: declaration of '__pid_t gettid() throw ()' has a different exception specifier
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~

Compiling succeeds, if getid() declaration in thread_map.h:

int getid();

is replaced by:

extern "C" {
__pid_t gettid() __THROW;
}

System: Arch Linux, kernel 5.4.2.

@PaulBGD
Copy link

PaulBGD commented Oct 7, 2020

Same thing happened to me, your fix works great. Anything we'd have to do to get this upstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants