This is the mail archive of the
mailing list for the GCC project.
Re: pthread.h INITIALIZER macros on solaris (solaris9 & 10 need fixes)
> > Based on what you showed me, I suspect the results should be
> > consistent with solaris7, i.e. it'll complain about
> > PTHREAD_ONCE_INIT, and with -ansi it'll complain on
> > PTHREAD_RWLOCK_INITIALIZER and twice for PTHREAD_ONCE_INIT.
> $ gcc -c -W -Wall -ansi test.c
> test.c: In function `test_it':
> test.c:17: warning: missing initializer
> test.c:17: warning: (near initialization for `pc.__pthread_cond_flags')
Um, that's completely unexpected! :-)
Solaris8 shouldn't complain about the COND macro at all since that is
supposedly "fixed". I get warnings for RWLOCK & ONCE on solaris7:
% gcc -c -W -Wall -ansi foo.c
pthr.c: In function 'foo':
pthr.c:8: warning: missing braces around initializer
pthr.c:8: warning: (near initialization for 'prwl.__pthread_rwlock_pad1')
pthr.c:9: warning: missing braces around initializer
pthr.c:9: warning: (near initialization for 'po.__pthread_once_pad')
Can you help me understand the discrepancy? Were you testing mainline
on solaris8 or some other version of gcc? What fixes if any were
applied to pthread.h for that gcc on that box?
Kaveh R. Ghazi email@example.com