Use of _PTHREADS for threadsafe STL allocation in 2.95.2
Jeff Greif
jmg@trivida.com
Mon Mar 27 17:17:00 GMT 2000
It's not clear to me whether this is a bug in gcc 2.95.2 or the supplied
STL, or whether I'm simply using the _PTHREADSÃÂ macro incorrectly.ÃÂ A
lot of warnings are produced from this source code:
ÃÂ
#define _PTHREADS 1
ÃÂ
#include <string>
ÃÂ
std::string foo;
The point of using _PTHREADS is to force the STL to use threadsafe
allocators.ÃÂ I wondered what is the meaning of the warning about "partly
bracketed initializer" and whether there is some way to suppress it, without
suppressing anything else.ÃÂ Thanks for any clarifying info.
ÃÂ
Jeff
ÃÂ
----------------------ÃÂ Details.ÃÂ Also see junk11.ii, junk11.s
attached --------------------------
ÃÂ
~/tv/TriVida/PredictorCore/predictor# g++ÃÂ -v --save-temps
-D_REENTRANT -DOS_SOLARIS_2_5 -DBUILDING_PREDICTOR_LIBRARY
-I/opt/ACE_wrappers.gcc -I../.. -I../../TVS_ostream -I.ÃÂ -g -Wall
-Wpointer-arith -Wno-return-type -fPIC -O2ÃÂ -c junk11.cpp Reading specs
from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs gcc version
2.95.2 19991024
(release) ÃÂ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/cpp
-lang-c++ -v -I/opt/ACE_wrappers.gcc -I../.. -I../../TVS_ostream -I.
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dsparc -Dsun -Dunix
-D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS
-D__OPTIMIZE__ -g -Wall -Wpointer-arith -Wno-return-type -D__GCC_NEW_VARARGS__
-Acpu(sparc) -Amachine(sparc) -D_REENTRANT -DOS_SOLARIS_2_5
-DBUILDING_PREDICTOR_LIBRARY junk11.cpp junk11.ii GNU CPP version 2.95.2
19991024 (release) (sparc) #include "..." search starts here: #include
<...> search starts
here: ÃÂ /opt/ACE_wrappers.gcc ÃÂ ../.. ÃÂ ../../TVS_ostream ÃÂ . ÃÂ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3 ÃÂ /usr/local/include ÃÂ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../sparc-sun-solaris2.6/include ÃÂ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/include ÃÂ /usr/include End
of search list. The following default directories have been omitted from the
search path: End of omitted
list. ÃÂ /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/cc1plus
junk11.ii -quiet -dumpbase junk11.cc -g -O2 -Wall -Wpointer-arith
-Wno-return-type -version -fPIC -o junk11.s GNU C++ version 2.95.2 19991024
(release) (sparc-sun-solaris2.6) compiled by GNU C version 2.95.2 19991024
(release). /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/stl_alloc.h:
In instantiation of
`__default_alloc_template<true,0>::_S_node_allocator_lock': /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/stl_alloc.h:394:ÃÂ ÃÂ
instantiated from
`__default_alloc_template<true,0>::_Lock::~_Lock()' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/stl_alloc.h:415:ÃÂ ÃÂ
instantiated from `__default_alloc_template<true,0>::allocate(unsigned
int)' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/std/bastring.cc:33:ÃÂ ÃÂ
instantiated from
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0>
>::Rep::operator new(unsigned int, unsigned
int)' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/std/bastring.cc:60:ÃÂ ÃÂ
instantiated from
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0>
>::Rep::create(unsigned
int)' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/std/bastring.cc:71:ÃÂ ÃÂ
instantiated from
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0>
>::Rep::clone()' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/std/bastring.h:75:ÃÂ ÃÂ
instantiated from
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0>
>::Rep::grab()' /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/std/bastring.h:171:ÃÂ ÃÂ
instantiated from
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0>
>::basic_string()' junk11.cpp:5:ÃÂ ÃÂ instantiated from
here /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/stl_alloc.h:581:
warning: aggregate has a partly bracketed
initializer /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/../../../../include/g++-3/stl_alloc.h:581:
warning: aggregate has a partly bracketed
initializer ÃÂ /usr/local/sparc-sun-solaris2.6/bin/as -V -Qy -s -K PIC -o
junk11.o junk11.s GNU assembler version 2.9.1 (sparc-sun-solaris2.6), using
BFD version 2.9.1
-----------------------------------------------------------------------------------
junk11.tar.gz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: junk11.tar.gz
Type: application/x-gzip
Size: 38180 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000327/84796979/attachment.bin>
More information about the Gcc-bugs
mailing list