Hello!

Recently, there was a couple of patches posted on gcc-patches that should fix various problems with solaris #includes. I would like to point out, that there is similar problem on x86_64 with libc-2.3.5 (Fedora Core 4)

--cut here--
GNU C Library development release version 2.3.5, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.0 20050525 (Red Hat 4.0.0-9).
Compiled on a Linux 2.4.20 system on 2005-05-30.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
Native POSIX Threads Library by Ulrich Drepper et al
The C stubs add-on version 2.1.2.
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Glibc-2.0 compatibility add-on by Cristian Gafton
GNU Libidn by Simon Josefsson
Thread-local storage support included.
--cut here--

The problem causes a couple of warnings in gcc build, like this:

/home/uros/gcc-build/./gcc/xgcc -B/home/uros/gcc-build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-svn/trunk/gcc -I../../gcc-svn/trunk/gcc/. -I../../gcc-svn/trunk/gcc/../include -I../../gcc-svn/trunk/gcc/../libcpp/include -I../../gcc-svn/trunk/gcc/../libdecnumber -I../libdecnumber -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../../gcc-svn/trunk/gcc/unwind-dw2-fde-glibc.c -o libgcc/./unwind-dw2-fde-glibc.o
In file included from ../../gcc-svn/trunk/gcc/unwind-dw2-fde-glibc.c:62:
../../gcc-svn/trunk/gcc/unwind-dw2-fde.c:53: warning: missing initializer
../../gcc-svn/trunk/gcc/unwind-dw2-fde.c:53: warning: (near initialization for ‘object_mutex.__data.__count’)

I have produced a short testcase, where the problem can be shown:

--cut here--
#include <pthread.h>
static pthread_mutex_t object_mutex = PTHREAD_MUTEX_INITIALIZER;
--cut here--

Compiling this with 'gcc -W' produces:
thread.c:3: warning: missing initializer
thread.c:3: warning: (near initialization for ‘object_mutex.__data.__count’)

I'm not familiar with fixincludes, but perhaps somebody will be interested in this problem.

Uros.

Reply via email to