public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: ufm@hnc.com To: gcc-gnats@gcc.gnu.org Cc: mayer@tux.org Subject: c++/4594: g++ warning with strings and threads Date: Wed, 17 Oct 2001 11:36:00 -0000 [thread overview] Message-ID: <200110171831.LAA21846@hydra.hnc.com> (raw) >Number: 4594 >Category: c++ >Synopsis: g++ warning with strings and threads >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Oct 17 11:36:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Uwe F. Mayer >Release: 3.0.2 20011007 (prerelease) >Organization: >Environment: System: SunOS hydra 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-2 Architecture: sun4 host: sparc-sun-solaris2.6 build: sparc-sun-solaris2.6 target: sparc-sun-solaris2.6 configured with: ../gcc-20011007/configure --prefix=/work/hyd01/td/sw/gcc-20011007-test --disable-nls --enable-threads=posix --disable-shared >Description: If any C++ program uses strings, then if compiled with -Wall several warnings are issued about a partially bracketed initializer in some of g++'s header files. This can be avoided, if g++ is configured with "--disable-threads", but then the javalib does not compile. My first attempt was to accept the threads default (i.e. no --enable-threads or --disable-threads statement during configuration), and then I tried single threads, and lastly posix threads. The warnings occur if threads are anything but single during configuration. Here is sample output of a compilation: hydra:src$ g++ -Wall -c void.cc /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h: In instantiation of `std::_STL_mutex_lock std::__default_alloc_template<true, 0>::_S_node_allocator_lock': /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h:316: instantiated from `std::__default_alloc_template<threads, inst>::_Lock::_Lock() [with bool threads = true, int inst = 0]' /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h:365: instantiated from `static void std::__default_alloc_template<threads, inst>::deallocate(void*, unsigned int) [with bool threads = true, int inst = 0]' /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h:588: instantiated from `void std::allocator<_Alloc>::deallocate(_Tp*, unsigned int) [with _Tp = char]' /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/basic_string.tcc:256: instantiated from `void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_destroy(const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/basic_string.h:180: instantiated from `void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_dispose(const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/basic_string.h:344: instantiated from `void std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' void.cc:4: instantiated from here /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h:523: warning: aggregate has a partly bracketed initializer /work/hyd01/td/sw/gcc-20011007-test/include/g++-v3/bits/stl_alloc.h:523: warning: aggregate has a partly bracketed initializer >How-To-Repeat: g++ -c -Wall void.cc The file void.cc: #include <string> using namespace std; int main () { string s; } >Fix: Disable threads during configuration, or don't use -Wall ... >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-10-17 11:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-10-17 11:36 ufm [this message] 2001-10-17 14:38 ljrittle 2001-10-17 14:56 Phil Edwards
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200110171831.LAA21846@hydra.hnc.com \ --to=ufm@hnc.com \ --cc=gcc-gnats@gcc.gnu.org \ --cc=mayer@tux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).