GNOME Bugzilla – Bug 594171
Style::get_style_property_value called from const method, causes errors with Intel Compiler
Last modified: 2009-09-21 10:01:39 UTC
I'm using Intel C++ compiler (11.1) to compile software using the system-installed gtkmm 2.16.0 (on openSUSE 11.1 x86_64). I get this error: /usr/include/gtkmm-2.4/gtkmm/style.h(1004): error: the object has cv-qualifiers that are not compatible with the member function. It seems that Style::get_style_property_value() (style.h:826) is not const, but is called from Style::get_style_property(), which is const, thus causing this error. I guess Style::get_style_property_value() should be const too. I've no idea how to patch it for upstream (it's using _WRAP_METHOD()).
Created attachment 143421 [details] [review] gtkmm_get_style_property.patch This patch might fix it, but I doubt that it's the right thing to do. We probably want both a const and non-const version, but I can't think how to make the output variable const for the const version.
Instead I have just added a const_cast that should hopefully fix this. Please confirm that: From the ChangeLog: 2009-09-21 Murray Cumming <murrayc@murrayc.com> * gtk/src/style.hg: get_style_property(): Use const_cast to maybe avoid a (correct) compiler error with the Intel C++ compiler. Bug #594171 (Alexander Shaduri). I added a TODO to fix this properly when we can break API.
(In reply to comment #2) > Instead I have just added a const_cast that should hopefully fix this. Please > confirm that: I patched the system-installed style.h from gtkmm-2.16.0 using the patch you submitted (sorry, I don't have the ability to test the git version right now), seems to work just fine! Thanks!