After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594171 - Style::get_style_property_value called from const method, causes errors with Intel Compiler
Style::get_style_property_value called from const method, causes errors with ...
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-09-04 20:45 UTC by Alexander Shaduri
Modified: 2009-09-21 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkmm_get_style_property.patch (1.41 KB, patch)
2009-09-18 06:37 UTC, Murray Cumming
none Details | Review

Description Alexander Shaduri 2009-09-04 20:45:49 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()).
Comment 1 Murray Cumming 2009-09-18 06:37:16 UTC
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.
Comment 2 Murray Cumming 2009-09-21 07:51:47 UTC
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.
Comment 3 Alexander Shaduri 2009-09-21 10:01:39 UTC
(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!