-Weffc++ (C++ only)

OK I spent the whole day today trying to find an error in my new project. I keep getting an error out of the guts of the vector library. I was convinced that I was doing somthing wrong. So after lunch and and some attemts to fix my code I decided to rewrite my Makefile because it was an horrible hack and I wanted to upload it to sourceforge. While doing this I noticed that I had added the -Weffc++ g++ flag after I had read Effective C++: 55 Specific Ways to Improve Your Programs and Designs
So for a test I just removed it and I had a clean build. So after some searching I found a nice little post that tells me that this is an known error. So that's it, one day of debugging for something they can't put in the deocumentation.

So if someone gets this error, you know now :
$man g++
When selecting this option, be aware that the standard library
headers do not obey all of these guidelines; use grep -v to filter
out those warnings.

bash-3.00$ g++ -c -g -Weffc++ `curl-config --cflags` Ui.cpp -o Ui.o
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/allocator.h: In instantiation of `std::allocator':
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:79: instantiated from `std::_Vector_base >::_Vector_impl'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:110: instantiated from `std::_Vector_base >'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:142: instantiated from `std::vector >'
Ui.cpp:45: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/allocator.h:81: warning: base class `class __gnu_cxx::new_allocator' has a non-virtual destructor
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h: In instantiation of `std::_Vector_base >::_Vector_impl':
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:110: instantiated from `std::_Vector_base >'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:142: instantiated from `std::vector >'
Ui.cpp:45: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:79: warning: base class `class std::allocator' has a non-virtual destructor
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:79: warning: `struct std::_Vector_base >::_Vector_impl' has pointer data members
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:79: warning: but does not override `std::_Vector_base >::_Vector_impl(const std::_Vector_base >::_Vector_impl&)'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:79: warning: or `operator=(const std::_Vector_base >::_Vector_impl&)'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h: In instantiation of `std::vector >':
Ui.cpp:45: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:142: warning: base class `struct std::_Vector_base >' has a non-virtual destructor
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h: In instantiation of `__gnu_cxx::__normal_iterator > >':
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564: instantiated from `void std::vector<_tp,>::push_back(const _Tp&) [with _Tp = std::string, _Alloc = std::allocator]'
Ui.cpp:95: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: `class __gnu_cxx::__normal_iterator > >' has pointer data members
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: but does not override `__gnu_cxx::__normal_iterator > >(const __gnu_cxx::__normal_iterator > >&)'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: or `operator=(const __gnu_cxx::__normal_iterator > >&)'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h: In instantiation of `__gnu_cxx::__normal_iterator > >':
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:375: instantiated from `size_t std::vector<_tp,>::size() const [with _Tp = std::string, _Alloc = std::allocator]'
Ui.cpp:130: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: `class __gnu_cxx::__normal_iterator > >' has pointer data members
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: but does not override `__gnu_cxx::__normal_iterator > >(const __gnu_cxx::__normal_iterator > >&)'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h:587: warning: or `operator=(const __gnu_cxx::__normal_iterator > >&)'
bash-3.00$

No comments: