public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/4594: g++ warning with strings and threads
@ 2001-10-17 11:36 ufm
  0 siblings, 0 replies; 3+ messages in thread
From: ufm @ 2001-10-17 11:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: mayer

>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:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/4594: g++ warning with strings and threads
@ 2001-10-17 14:56 Phil Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Edwards @ 2001-10-17 14:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/4594; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: ljrittle@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, mayer@tux.org
Subject: Re: c++/4594: g++ warning with strings and threads
Date: Wed, 17 Oct 2001 17:50:02 -0400

 On Wed, Oct 17, 2001 at 09:38:21PM -0000, ljrittle@gcc.gnu.org wrote:
 > State-Changed-Why:
 >     Works on Solaris 2.7.  Sun (again) changed system headers
 >     between 2.6 and 2.7.
 
 Yes, AFAICT this problem is unique to Solaris 2.6.
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/4594: g++ warning with strings and threads
@ 2001-10-17 14:38 ljrittle
  0 siblings, 0 replies; 3+ messages in thread
From: ljrittle @ 2001-10-17 14:38 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mayer, nobody

Synopsis: g++ warning with strings and threads

State-Changed-From-To: open->analyzed
State-Changed-By: ljrittle
State-Changed-When: Wed Oct 17 14:38:20 2001
State-Changed-Why:
    Works on Solaris 2.7.  Sun (again) changed system headers
    between 2.6 and 2.7.  FYI, few/no people are supporting
    older Solaris releases (Sun hasn't volunteered such effort
    as far as I can see).  However, a patch for your exact
    problem was posted some time ago.  We were never able to
    resolve all problems with the patch in order to get it
    in the official gcc tree.  Sorry, I don't have a reference.
    You might try searching for rittle&solaris&pthread on
    gcc-patches.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4594&database=gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-17 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-17 11:36 c++/4594: g++ warning with strings and threads ufm
2001-10-17 14:38 ljrittle
2001-10-17 14:56 Phil Edwards

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).