GNOME Bugzilla – Bug 555743
warning in glibmm
Last modified: 2008-11-29 17:18:35 UTC
When building with glibmm 2.17.3 I get these warnings: /usr/include/glibmm-2.4/glibmm/nodetree.h: In constructor ‘Glib::NodeTree<T>::NodeTree(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:103: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::insert_data(int, const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:222: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::insert_data_before(Glib::NodeTree<T>&, const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:236: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::append_data(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:249: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::prepend_data(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:262: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::find_child(const T&, Glib::NodeTree<T>::TraverseFlags)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:345: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘const Glib::NodeTree<T>* Glib::NodeTree<T>::find_child(const T&, Glib::NodeTree<T>::TraverseFlags) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:364: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::find(const T&, Glib::TraverseType, Glib::NodeTree<T>::TraverseFlags)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:377: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘const Glib::NodeTree<T>* Glib::NodeTree<T>::find(const T&, Glib::TraverseType, Glib::NodeTree<T>::TraverseFlags) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:398: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘int Glib::NodeTree<T>::child_index(const T&) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:409: warning: declaration of ‘data’ shadows a member of 'this'
How about glibmm 2.18.0?
yeah, seems that this should be fixed since the class member is now named 'data_', not 'data' (though I wonder why we didn't use our normal convention and call it 'm_data'...). Hubert, can you confirm?
I'd be happy to change to m_. It should be no API/ABI problem.
I won't change to an m_ prefix because we actually use a _ suffix in other places, such as in objectbase.h So I assume that there is nothing left to do for this bug.
sorry but I have to reopen this: /usr/include/glibmm-2.4/glibmm/nodetree.h: In constructor ‘Glib::NodeTree<T>::NodeTree(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:103: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::insert_data(int, const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:222: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::insert_data_before(Glib::NodeTree<T>&, const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:236: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::append_data(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:249: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::prepend_data(const T&)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:262: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::find_child(const T&, Glib::NodeTree<T>::TraverseFlags)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:345: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘const Glib::NodeTree<T>* Glib::NodeTree<T>::find_child(const T&, Glib::NodeTree<T>::TraverseFlags) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:364: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘Glib::NodeTree<T>* Glib::NodeTree<T>::find(const T&, Glib::TraverseType, Glib::NodeTree<T>::TraverseFlags)’: /usr/include/glibmm-2.4/glibmm/nodetree.h:377: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘const Glib::NodeTree<T>* Glib::NodeTree<T>::find(const T&, Glib::TraverseType, Glib::NodeTree<T>::TraverseFlags) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:398: warning: declaration of ‘data’ shadows a member of 'this' /usr/include/glibmm-2.4/glibmm/nodetree.h: In member function ‘int Glib::NodeTree<T>::child_index(const T&) const’: /usr/include/glibmm-2.4/glibmm/nodetree.h:409: warning: declaration of ‘data’ shadows a member of 'this' version is 2.18.1
A patch would be welcome.
The other problem is that NodeTree::data() exists. So what if the function parameter is named _data to not conflict? Will craft a patch.
Oh, that's an annoying check. I'd prefer the_data or something else not involving a leading or trailing _. Thanks.
(In reply to comment #8) > Oh, that's an annoying check. That's actually an important one > I'd prefer the_data or something else not involving a leading or trailing _. > Thanks. ok.
Created attachment 123639 [details] [review] patch If the patch is OK for you, I can commit it to trunk.
Yes, please, and to the latest branch, with a ChangeLog entry. Thanks.
Committed to trunk (as there is no 2.18 branch) This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.