prog.c:5:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘-’ token
pthread_t TH-begin,TH_end;
^
prog.c: In function ‘search_From_begin’:
prog.c:12:4: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
usleep(500);
^~~~~~
prog.c:15:20: error: ‘TH_end’ undeclared (first use in this function)
pthread_cancel(TH_end);
^~~~~~
prog.c:15:20: note: each undeclared identifier is reported only once for each function it appears in
prog.c: In function ‘search_From_end’:
prog.c:30:20: error: ‘TH_begin’ undeclared (first use in this function)
pthread_cancel(TH_begin);
^~~~~~~~
prog.c: At top level:
prog.c:37:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
void main(){
^~~~
prog.c: In function ‘main’:
prog.c:45:19: error: ‘TH_begin’ undeclared (first use in this function)
pthread_create(&TH_begin,NULL,&search_From_begin,j); // creation du thread t1
^~~~~~~~
prog.c:45:33: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [-Wincompatible-pointer-types]
pthread_create(&TH_begin,NULL,&search_From_begin,j); // creation du thread t1
^
In file included from prog.c:2:0:
/usr/include/pthread.h:233:12: note: expected ‘void * (*)(void *)’ but argument is of type ‘void (*)(int)’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
prog.c:45:52: warning: passing argument 4 of ‘pthread_create’ makes pointer from integer without a cast [-Wint-conversion]
pthread_create(&TH_begin,NULL,&search_From_begin,j); // creation du thread t1
^
In file included from prog.c:2:0:
/usr/include/pthread.h:233:12: note: expected ‘void * restrict’ but argument is of type ‘int’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
prog.c:46:19: error: ‘t2’ undeclared (first use in this function)
pthread_create(&t2,NULL,&search_From_end,j); // creation du thread t2
^~
prog.c:46:27: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [-Wincompatible-pointer-types]
pthread_create(&t2,NULL,&search_From_end,j); // creation du thread t2
^
In file included from prog.c:2:0:
/usr/include/pthread.h:233:12: note: expected ‘void * (*)(void *)’ but argument is of type ‘void (*)(int)’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
prog.c:46:44: warning: passing argument 4 of ‘pthread_create’ makes pointer from integer without a cast [-Wint-conversion]
pthread_create(&t2,NULL,&search_From_end,j); // creation du thread t2
^
In file included from prog.c:2:0:
/usr/include/pthread.h:233:12: note: expected ‘void * restrict’ but argument is of type ‘int’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
prog.c:48:16: error: ‘TH_end’ undeclared (first use in this function)
pthread_join(TH_end,NULL); // attendre le thread t2
^~~~~~
prog.c:50:18: error: ‘variable_globale’ undeclared (first use in this function)
printf("V= %d\n",variable_globale); // afficher la valeur de var
^~~~~~~~~~~~~~~~
prog.c:51:9: warning: ‘return’ with a value, in function returning void
return 0;
^
prog.c:37:6: note: declared here
void main(){
^~~~