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

MinGW, GCC 14.1: incompatible pointer types in pthread_create #411

Closed
LigH-de opened this issue Jul 30, 2024 · 1 comment
Closed

MinGW, GCC 14.1: incompatible pointer types in pthread_create #411

LigH-de opened this issue Jul 30, 2024 · 1 comment

Comments

@LigH-de
Copy link

LigH-de commented Jul 30, 2024

../../src/threadqueue.c: In function 'kvz_threadqueue_init':
../../src/threadqueue.c:416:50: error: passing argument 2 of 'pthread_create' from incompatible pointer type [-Wincompatible-pointer-types]
  416 |     if (pthread_create(&threadqueue->threads[i], &attr, threadqueue_worker, threadqueue) != 0) {
      |                                                  ^~~~~
      |                                                  |
      |                                                  pthread_attr_t **
In file included from ../../src/threadqueue.h:43,
                 from ../../src/threadqueue.c:34:
G:/MABS/msys64/mingw32/include/pthread.h:320:78: note: expected 'const pthread_attr_t *' but argument is of type 'pthread_attr_t **'
  320 | WINPTHREAD_API int       pthread_create(pthread_t *th, const pthread_attr_t *attr, void *(* func)(void *), void *arg);
      |                                                        ~~~~~~~~~~~~~~~~~~~~~~^~~~

GCC 14.1 takes the const more serious than 13, I guess.

But you are already planning to prefer a Windows native API over pthread instead: #403

@Jovasa
Copy link
Member

Jovasa commented Jul 30, 2024

Fixed in a7aeb23

@Jovasa Jovasa closed this as completed Jul 30, 2024
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