[forwarded from http://bugs.debian.org/] gcc version 4.0.2 20050806 Warning is "_M_header should be initialized in the member intialization list". Ok, patch follows: --- /usr/include/c++/4.0.1/bits/stl_tree.h~ 2005-07-12 06:15:28.000000000 +0200 +++ /usr/include/c++/4.0.1/bits/stl_tree.h 2005-08-09 15:43:32.000000000 +0200 @@ -401,7 +401,7 @@ _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0) + : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), _M_node_count(0) { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0;
In the FAQ (4.4), things that only looks like bugs, mentions that libstdc++ isn't -Weffc++ clean.
(In reply to comment #1) > In the FAQ (4.4), things that only looks like bugs, mentions that libstdc++ isn't -Weffc++ clean. And more than that, there is a bug in that database which is suspended for libstdc++ vs -Weffc++, PR 12854.
Having a testcase to reproduce this would be nice.
Reproducer, compile with -Weffc++. #include <list> std::list<int> l; ...fixing....
Subject: Bug 23417 CVSROOT: /cvs/gcc Module name: gcc Changes by: bkoz@gcc.gnu.org 2005-09-12 19:48:05 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_list.h Log message: 2005-09-12 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/23417 * include/bits/stl_list.h (_List_impl): Use member initialization list for -Weffc++. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3097&r2=1.3098 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&r1=1.52&r2=1.53
Subject: Bug 23417 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: bkoz@gcc.gnu.org 2005-09-12 19:54:56 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_list.h Log message: 2005-09-12 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/23417 * include/bits/stl_list.h (_List_impl): Use member initialization list for -Weffc++. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2917.2.80&r2=1.2917.2.81 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.47.6.1&r2=1.47.6.2
Benjamin, can you also check, say, std::set? After all the PR is about stl_tree.h... ;)
Yep. Sorry. I fixed that bit too. -benjamin
Subject: Bug 23417 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: bkoz@gcc.gnu.org 2005-09-12 20:09:18 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_tree.h Log message: 2005-09-12 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/23417 * include/bits/stl_list.h (_List_impl): Use member initialization list for -Weffc++. * include/bits/stl_tree.h (_Rb_tree_impl): Same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2917.2.81&r2=1.2917.2.82 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.44.6.2&r2=1.44.6.3
Subject: Bug 23417 CVSROOT: /cvs/gcc Module name: gcc Changes by: bkoz@gcc.gnu.org 2005-09-12 20:32:54 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_tree.h Log message: 2005-09-12 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/23417 * include/bits/stl_list.h (_List_impl): Use member initialization list for -Weffc++. * include/bits/stl_tree.h (_Rb_tree_impl): Same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3098&r2=1.3099 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&r1=1.48&r2=1.49
Fixed.
Subject: Bug 23417 CVSROOT: /cvs/gcc Module name: gcc Changes by: paolo@gcc.gnu.org 2005-09-18 13:39:26 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_tree.h Log message: 2005-09-18 Paolo Carlini <pcarlini@suse.de> PR libstdc++/23417 (cont) * include/bits/stl_tree.h (_Rb_tree_impl<true>): Use member initialization list for -Weffc++. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3109&r2=1.3110 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&r1=1.49&r2=1.50