example.c: fix a warning
Closed this issue · 1 comments
dark-w commented
i found a grammar warning in the No.20 line of example.c when i used compile option '-Wall -Werror'
dark@ubuntu:~/github/sokoban/points/thread-pool$ make
gcc -Wall -Werror -O2 thpool.c example.c -o thpool -lpthread
example.c: In function ‘task’:
example.c:20:60: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
20 | printf("Thread #%u working on %d\n", (int)pthread_self(), (int) arg);
| ^
cc1: all warnings being treated as errors
make: *** [Makefile:9: thpool] Error 1
dark-w commented
just change to "printf("Thread #%u working on %lu\n", (int)pthread_self(), (size_t)arg);", then all right :)