Hello, I just tried to compile sigc++ with the latest g++ 3.2.1. With 3.1.x it works, but with 3.2.1 it doesn't; I got sth like this: In file included from /usr/local/gcc/3.2.1/include/c++/3.2.1/backward/iostream.h:31, from configure:8485: /usr/local/gcc/3.2.1/include/c++/3.2.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. In file included from /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_alloc.h:86, from /usr/local/gcc/3.2.1/include/c++/3.2.1/memory:55, from /usr/local/gcc/3.2.1/include/c++/3.2.1/string:48, from /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/localefwd.h:49, from /usr/local/gcc/3.2.1/include/c++/3.2.1/ios:48, from /usr/local/gcc/3.2.1/include/c++/3.2.1/ostream:45, from /usr/local/gcc/3.2.1/include/c++/3.2.1/iostream:45, from /usr/local/gcc/3.2.1/include/c++/3.2.1/backward/iostream.h:32, from configure:8485: /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h: In constructor `std::_Refcount_Base::_Refcount_Base(unsigned int)': /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h:74: initializer for scalar variable requires one element /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h: At global scope: /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h: In instantiation of `__gthread_mutex_t std::_Swap_lock_struct<0>::_S_swap_lock': /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h:122: instantiated from here /usr/local/gcc/3.2.1/include/c++/3.2.1/bits/stl_threads.h:115: initializer for scalar variable requires one element Release: gcc 3.2.1 Environment: i686-pc-linux-gnu glibc 2.3.1 How-To-Repeat: g++ -v --save-temp -lc -lm -lpthread 1.ii
Fix: use 3.1.x
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. The problem comes from code like this, buried deep inside libstdc++: -------------------- struct pthread_mutex_st { void * res0; int res1; int res2; int res3; int res4; int res5; }; struct pthread_mutexattr_st; //... typedef pthread_mutex_t __gthread_mutex_t; //... __gthread_mutex_t __tmp = {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, { 0, 0 }}; ----------------------- This happens in bits/stl_threads.h:74, so I better reclassify it for libstdc++. Georg, in this case it would be interesting to have the original, unpreprocessed code, to see whether it works with newer and/or older versions of gcc. Can you provide a stripped down version of it? Thanks W.
State-Changed-From-To: analyzed->open State-Changed-Why: Thanks Georg, for the source. I cannot reproduce the problem, which may have to do with the fact that I am using glibc2.2.5. Someone with a glibc2.3.1 may want to look into this.
From: Georg Wild <gwild@ph.tum.de> To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, georg.wild@gmx.de, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: libstdc++/8731: thread mutex initializers Date: Thu, 28 Nov 2002 10:59:40 +0100 See also glibc bug 4917 http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=glibc&pr=4917&return_url=http%3A%2F%2Fbugs.gnu.org%2Fcgi-bin%2Fgnatsweb.pl%3Fdatabase%3Dglibc%3Bdebug%3D%3BCategory%3Dany%3BConfidential%3Dany%3BSeverity%3Dany%3BPriority%3Dany%3BResponsible%3Dany%3BState%3Dany%3BClass%3Dany%3BSubmitter-Id%3Dgnatsweb%3BSynopsis%3D%3Bmultitext%3D%3Bcolumns%3DCategory%3Bcolumns%3DSynopsis%3Bcolumns%3DConfidential%3Bcolumns%3DSeverity%3Bcolumns%3DPriority%3Bcolumns%3DResponsible%3Bcolumns%3DState%3Bcolumn s%3DQuarter%3Bcolumns%3DKeywords%3Bcolumns%3DDate-Required%3Bcolumns%3DClass%3Bcolumns%3DSubmitter-Id%3Bcolumns%3DArrival-Date%3Bcolumns%3DClosed-Date%3Bcolumns%3DCases%3Bcolumns%3DLast-Modified%3Bcolumns%3DOriginator%3Bcolumns%3DRelease%3Bsortby%3DNumber%3Bdisplaydate%3DCurrent%2520Date%3Bcmd%3Dsubmit%2520query Because of this (bad) spam protection system nearly no mails are sent to this bug report; I' ll foreard one of Paolo Carlini <pcarlini@unitus.it>: >Hi. I'm on glibc2.3.1 and indeed can confirm this. > > Paolo. >http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8731 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8731
Does this still happen on 3.3?
Well, in the meantime I use glibc 2.3.2, gcc 3.3 and the last sigc++ was 1.2.5. I a time ago installed this, and obviously it worked, but maybe they changed the code. When I try to compile this attachment 1.ii, I get the following, but I think you must have the real source file to compile, but I haven't: /tmp>gcc 1.ii In file included from /usr/local/gcc/3.2/include/c++/3.2/bits/stl_alloc.h:86, from /usr/local/gcc/3.2/include/c++/3.2/memory:55, from /usr/local/gcc/3.2/include/c++/3.2/string:48, from /usr/local/gcc/3.2/include/c++/3.2/bits/localefwd.h:49, from /usr/local/gcc/3.2/include/c++/3.2/ios:48, from /usr/local/gcc/3.2/include/c++/3.2/ostream:45, from /usr/local/gcc/3.2/include/c++/3.2/iostream:45, from /usr/local/gcc/3.2/include/c++/3.2/backward/iostream.h:32, from configure:8485: /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h: In constructor ` std::_Refcount_Base::_Refcount_Base(unsigned int)': /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h:74: error: brace-enclosed initializer used to initialize `int' /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h: At global scope: /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h: In instantiation of `__gthread_mutex_t std::_Swap_lock_struct<0>::_S_swap_lock': /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h:122: instantiated from here /usr/local/gcc/3.2/include/c++/3.2/bits/stl_threads.h:115: error: brace-enclosed initializer used to initialize `int'
Fixed according to the submitter.