lhmouse/mcfgthread

Function declaration incorrect for c11

trcrsired opened this issue · 0 comments

#include <threads.h>
#include <stdio.h>

int run(void *arg)
{
    printf("Hello world of C11 threads.");

    return 0;
}

int main(int argc, const char *argv[])
{
    thrd_t thread;
    int result;

    thrd_create(&thread, run, NULL);

    thrd_join(&thread, &result);

    printf("Thread return %d at the end\n", result);
}

threadtest.c: In function 'main':
threadtest.c:18:15: warning: passing argument 1 of 'thrd_join' from incompatible pointer type [-Wincompatible-pointer-types]
18 | thrd_join(&thread, &result);
| ^~~~~~~
| |
| _MCF_thread **
In file included from d:\x86_64-windows-gnu\x86_64-w64-mingw32-mcf\x86_64-w64-mingw32\include\threads.h:3,
from threadtest.c:1:
d:\x86_64-windows-gnu\x86_64-w64-mingw32-mcf\x86_64-w64-mingw32\include\mcfgthread\c11.h:304:42: note: expected 'thrd_t' {aka '_MCF_thread *'} but argument is of type '_MCF_thread *'
304 | __MCF_ALWAYS_INLINE int thrd_join(thrd_t __thrd, int
__resp_opt) __MCF_NOEXCEPT { return __MCF_c11_thrd_join(__thrd, __resp_opt); }