[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#427722: marked as done (pthread_kill() declaration disappears when compiling with -ansi)



Your message dated Wed, 6 Jun 2007 11:03:22 +0200
with message-id <20070606090322.GA7341@.intersec.eu>
and subject line Bug#427722: pthread_kill() declaration disappears when compiling with -ansi
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
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 */


--- End Message ---
--- Begin Message ---
On Tue, Jun 05, 2007 at 07:04:27PM -0700, Daniel F. Smith wrote:
> 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.

  Old behaviour is wrong. pthread_kill is defined in IEEE Std 2003.1
with threads extensions.

  Using -ansi, you use plain old C, with no POSIX extensions, hence need
to "define" some features see features_test_macros(7).

  To have pthread_kill you need to -D_POSIX_C_SOURCE=199506 or
-D_XOPEN_SOURCE=500 at the strict minimum. (see man page and/or
<features.h> for explanations).

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpNi34wp3Gcd.pgp
Description: PGP signature


--- End Message ---

Reply to: