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

pthread_getname_np() too few arguments to function call, expected 2, have 1 #743

Closed
DenisPolygalov opened this issue Mar 24, 2023 · 2 comments

Comments

@DenisPolygalov
Copy link

Hi,
this:

(void)pthread_setname_np(th.name);

contradicts documentation for both Linux:

https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html

and FreeBSD. Note that the signature in FreeBSD version is this one:
int pthread_setname_np(pthread_t thread, const char *name);
I guess this is similar to what happened here:

mitsuba-renderer/mitsuba#39

I don't see any simple fix from my side, so hope you may consider to change this somehow...
Regards,
Denis.

@sreimers
Copy link
Member

This should fix the problem:

9d1b8d2

@DenisPolygalov
Copy link
Author

Thank you for the quick response, but it seems like there is a small issue with the fix.
This line:

(void)pthread_setname_np(th.thr, th.name);

gives me warning:
incompatible pointer types passing 'thrd_t *' (aka 'struct pthread **') to parameter of type 'pthread_t' (aka 'struct pthread *'); dereference with * [-Wincompatible-pointer-types]

I changed
(void)pthread_setname_np(th.thr, th.name);
to
(void)pthread_setname_np(*th.thr, th.name);
but I am not sure this solution is correct. The baresip compiles and runs though...
Could you please check and include into the next libre release if this is correct?
Regards,
Denis.

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