Author Topic: r9738 compile error with wx3.0-trunk  (Read 11807 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
r9738 compile error with wx3.0-trunk
« on: March 14, 2014, 07:37:17 pm »
I get the followinhg error with wx3.0 trunk on my linux system (64bit gcc 4.8):
Quote
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp: In function 'int CCManagerHelper::CallTipToInt(const wxString&, int)':
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: error: ambiguous overload for 'operator^' (operand types are 'int' and 'wxString::const_iterator::reference {aka wxUniChar}')
             val = 33 * val ^ (*itr);
                            ^
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: candidates are:
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, int) <built-in>
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, unsigned int) <built-in>
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, long int) <built-in>
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, long unsigned int) <built-in>
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, long long int) <built-in>
/home/jens/codeblocks-build/codeblocks.git/src/sdk/ccmanager.cpp:72:28: note: operator^(int, long long unsigned int) <built-in>
Casting the (*itr) to int makes the error go away, but as I don't know what this function does, I don't know if this is the corect fix or does something really harmful.

@Alpha and other devs more familiar with CC could you please look into it ?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: r9738 compile error with wx3.0-trunk
« Reply #1 on: March 14, 2014, 08:27:21 pm »
Casting the (*itr) to int makes the error go away, but as I don't know what this function does, I don't know if this is the corect fix or does something really harmful.
@Alpha and other devs more familiar with CC could you please look into it ?
That is the correct fix.
(The function is used to store a dictionary between calltip context, and the previously user selected calltip page.  I choose to store an int (hash value) instead of the full strings, because CCManager has no need to waste memory duplicating all displayed calltips.)

Edit: Fix committed.
« Last Edit: March 14, 2014, 09:03:05 pm by Alpha »