C
Chris Dollin
Ian said:Hi All,
Just illustrating my lack of C knowledge again:
Wot now ? cat test.c
#include <pthread.h>
void thread_init( void ){}
Wot now ? xlc_r -c -qlanglvl=stdc89 test.c
"test.c", line 3.6: 1506-343 (S) Redeclaration of thread_init differs from previous declaration on line 886 of "/usr/include/sys/thread.h".
"test.c", line 3.6: 1506-376 (I) Redeclaration of thread_init has a different number of fixed parameters than the previous declaration.
Wot now ? xlc_r -c -qlanglvl=stdc99 test.c
"test.c", line 3.6: 1506-343 (S) Redeclaration of thread_init differs from previous declaration on line 886 of "/usr/include/sys/thread.h".
"test.c", line 3.6: 1506-376 (I) Redeclaration of thread_init has a different number of fixed parameters than the previous declaration.
In sys/thread.h thread_init is declared as
void thread_init(unsigned long long, unsigned long long)
and the -qlanglvl flags above ask the compiler to at least report deviations
from the c89 and c99 standards respectively.
Is the implementation allowed by the standard to reserve this part of the namespace ?
You've included a non-standard header; the (C) standard doesn't prohibit non-standard
headers from eating names that the standard headers don't eat.
I see your compiler doesn't remark on the non-standardness of <pthread.h>.