Pithikos/C-Thread-Pool

Do not quite understand example.c - lines 37&38

Opened this issue · 1 comments

Hi,

Maybe it's not really an issue but I can't find anywhere else to ask… I read thpool.c and it seems that the 2nd argument of thpool_add_work is a "function pointer", but in example.c, lines 37&38, the type of 2nd argument is explicitly (void*).

I was not familiar with that, but on StackOverflow I found a question Why can't I cast a function pointer to (void *)?, which might be related to this case (although I'm not quite sure whether this case is the so-called casting).

By the way, adding -Wpedantic does give warnings when I compile example.c. Either removing (void*) or replacing it with (void (*)()) will make the warnings disappear (although other warnings exist).

hello my friend : ), don't worry about it, i think it's just a usage mistake about c grammar, i checked example.c and it's ok now. @ghost