R
Roy Smith
I'm trying to build the BIND-8 name resolver library and am getting the
following error:
/opt/toolset/compiler/FD7/SUNWspro/bin/cc -mt -g
-I/work/smithr/tickets/24256.sbc-leak/MAIN/users/smithr/resolver-te\
st/bind/bind-9.3.1/lib/bind
-I/work/smithr/tickets/24256.sbc-leak/MAIN/users/smithr/resolver-test/bind/b
ind-9.3.1/lib/\
bind/make/../port/solaris/include -I.. -I./../include -D_REENTRANT
-c gai_strerror.c
"gai_strerror.c", line 58: too many initializers for scalar
cc: acomp failed for gai_strerror.c
This is on a Solaris-8 box with the Sun compiler. The offending line of
code is:
static pthread_mutex_t lock = LIBBIND_MUTEX_INITIALIZER;
which, when I run the compile with -E, gets expanded to:
static pthread_mutex_t lock = { { { 0 , 0 , 0 , 0 , 0 } , { { { 0
} } } , 0 } };
pthread_mutex_t in turn is:
typedef struct _pthread_mutex {
struct {
uint16_t __pthread_mutex_flag1;
uint8_t __pthread_mutex_flag2;
uint8_t __pthread_mutex_ceiling;
uint16_t __pthread_mutex_type;
uint16_t __pthread_mutex_magic;
} __pthread_mutex_flags;
union {
struct {
uint8_t __pthread_mutex_pad[8];
} __pthread_mutex_lock64;
struct {
uint32_t __pthread_ownerpid;
uint32_t __pthread_lockword;
} __pthread_mutex_lock32;
upad64_t __pthread_mutex_owner64;
} __pthread_mutex_lock;
upad64_t __pthread_mutex_data;
} pthread_mutex_t;
This looks perfectly reasonable to me. The first five 0's get assigned to
....flag1 through ...magic, the next 0 is __pthread_mutex_pad[0], and the
last 0 is __pthread_mutex_data. Why the compiler error?
following error:
/opt/toolset/compiler/FD7/SUNWspro/bin/cc -mt -g
-I/work/smithr/tickets/24256.sbc-leak/MAIN/users/smithr/resolver-te\
st/bind/bind-9.3.1/lib/bind
-I/work/smithr/tickets/24256.sbc-leak/MAIN/users/smithr/resolver-test/bind/b
ind-9.3.1/lib/\
bind/make/../port/solaris/include -I.. -I./../include -D_REENTRANT
-c gai_strerror.c
"gai_strerror.c", line 58: too many initializers for scalar
cc: acomp failed for gai_strerror.c
This is on a Solaris-8 box with the Sun compiler. The offending line of
code is:
static pthread_mutex_t lock = LIBBIND_MUTEX_INITIALIZER;
which, when I run the compile with -E, gets expanded to:
static pthread_mutex_t lock = { { { 0 , 0 , 0 , 0 , 0 } , { { { 0
} } } , 0 } };
pthread_mutex_t in turn is:
typedef struct _pthread_mutex {
struct {
uint16_t __pthread_mutex_flag1;
uint8_t __pthread_mutex_flag2;
uint8_t __pthread_mutex_ceiling;
uint16_t __pthread_mutex_type;
uint16_t __pthread_mutex_magic;
} __pthread_mutex_flags;
union {
struct {
uint8_t __pthread_mutex_pad[8];
} __pthread_mutex_lock64;
struct {
uint32_t __pthread_ownerpid;
uint32_t __pthread_lockword;
} __pthread_mutex_lock32;
upad64_t __pthread_mutex_owner64;
} __pthread_mutex_lock;
upad64_t __pthread_mutex_data;
} pthread_mutex_t;
This looks perfectly reasonable to me. The first five 0's get assigned to
....flag1 through ...magic, the next 0 is __pthread_mutex_pad[0], and the
last 0 is __pthread_mutex_data. Why the compiler error?