Bug#427722: pthread_kill() declaration disappears when compiling with -ansi
Package: libc6-dev
Version: 2.5-9+b1
When compiling with the -ansi flag in gcc, pthread_kill() is implicitly
defined. The old behavior worked with -ansi. See this example.
cat <<EOF >test.c
#include <pthread.h>
#include <signal.h>
void *start(void *arg) {return NULL;}
void test(void) {
pthread_t t;
(void)pthread_create(&t,NULL,start,NULL);
pthread_kill(t,SIGKILL);
}
EOF
$ gcc -Wall -c test.c
(no warnings)
$ gcc -ansi -Wall -c test.c
test.c: In function 'test':
test.c:9: warning: implicit declaration of function 'pthread_kill'
$ uname -a
Linux porter 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 GNU/Linux
$ ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 11 Jun 4 13:26 /lib/libc.so.6 -> libc-2.5.so
$ dpkg -s libc6 | grep Version
Version: 2.5-9+b1
$ ls -l /usr/include/signal.h
-rw-r--r-- 1 root root 13312 May 30 03:04 /usr/include/signal.h
$ ls -l /usr/include/bits/pthreadtypes.h
-rw-r--r-- 1 root root 4395 May 30 03:04 /usr/include/bits/pthreadtypes.h
$ tail -20 /usr/include/signal.h | head -6
#if defined __USE_POSIX199506 || defined __USE_UNIX98
/* Some of the functions for handling signals in threaded programs must
be defined here. */
# include <bits/pthreadtypes.h>
# include <bits/sigthread.h>
#endif /* use Unix98 */
Reply to: