Bug#402971: More on the bug
I figure out a few things about this bug. Either cstdlib is wrong or
the /usr/include/pthread.h from pthread-dev is wrong.
Both /usr/include/c++/4.1.2/cstdlib (line 99) and
/usr/include/c++/3.4/cstdlib (line 80) have the following macro:
#undef system
Whereas the header /usr/include/pthread.h that comes with libpthread-dev
(notice that the one that comes with glibc works fine) has the following
macro at line 521:
#define system __pthread_system
The system macro is undefined by the cstdlib header and that's what ends
up giving us that error
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:135:
error: '::system' has not been declared
Clearly the definition that should be used was the one that has the
following prototype:
int __pthread_system(const char *);
In the case of the glibc version of the pthread.h header is used, then
the prototype on /usr/include/stdlib.h ends up being used.
The way I see it there are two solutions for the bug:
1. Removing the line
#undef system
from cstdlib
2. Changing /usr/include/pthread.h so, instead of having a macro like
#define system __pthread_system
we could have a function definition like
int system(const char *s) { return __pthread_system(s); }
I think the first solution is the best one.
PS: Sorry about the post using yahoo mail, it really does suck :(.
Reply to: