This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Solaris & pthread mutex initializers

> The current scheme isn't exactly working and the right way to do
> it seems hard.  (leastwise, until Sun itself provides for a
> "upad64_t" initializer and uses that in the initializer...).


> The data structures being initialized are actually defined
> in /usr/include/sys/types.h and they seem to change every time
> that file wiggles.

Note that there is an exception: Solaris 2.5.1 (that is still supported in 
4.0.x).  For example, pthread.h as of

#pragma ident   "@(#)pthread.h  1.13    95/08/24 SMI"

defines pthread_mutex_t and pthread_cond_t.  We should keep fixincluding it.

> Therefore, determining which flavor of initializer 
> to use really needs to depend upon the version of that  file.
> In poking around, I've discovered six flavors in the wild,
> and I guess there to be more:
>     case 51: pi = &types_51; break; /* sol  6 */
>     case 63: pi = &types_63; break; /* sol  7 */
>     case 66: pi = &types_66; break; /* sol  8 */
>     case 69: pi = &types_69; break; /* sol  8 */
>     case 74: pi = &types_74; break; /* sol  9 */
>     case 84: pi = &types_84; break; /* sol 10 */
> and they are all different.  Notice that there are
> *two* for sol 8.  Attached is a patch, including an
> example of what it did to my /usr/include/pthread.h
> header.  I guess the "right thing" is to try to get
> the rest of the types.h versions filled in....

I can provide the following variant for Solaris 9:

#pragma ident   "@(#)types.h    1.75    04/01/06 SMI"

Could you refrain from committing anything until after PR middle-end/19515 is 
resolved?  This is a (critical) bug I spotted because the initializers don't 
use the {0,0,0,0,0,0,0,0} form.  Applying your patch will hide it.

Thanks for tackling this!

Eric Botcazou

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]