Author Topic: Variable tooltip confusion  (Read 2511 times)

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Variable tooltip confusion
« on: September 28, 2015, 07:26:40 pm »
First of all, sorry for a non-informative title...

(Potentially important details: r10507, Ubuntu x64, wx2.8.12, wx Project)

Let's say we have somewhere early on in the .cpp file:
Code
BetterwxObject* Layer = NULL;
If we hover over the "Layer", we get the proper tooltip
Code
BetterwxObject* Layer
So far so good. And for many more occurences of this "Layer" variable.
Until, several screens lower, we stumble upon this:
Code
if (!SomeBoolean && Layer)
After this line comes into view (and maybe hoverting over the Layer in this line), the Layer tooltip permanently (until restart) gets ruined into:
Code
! SomeBoolean&& Layer

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Variable tooltip confusion
« Reply #1 on: September 28, 2015, 08:07:25 pm »
Can you post a minimal code sample that demonstrates the problem?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: Variable tooltip confusion
« Reply #2 on: September 28, 2015, 11:39:41 pm »
Just used the template for a console project and added the mentioned variables.
Code
#include <iostream>

using namespace std;
string* Layer = NULL;

int main()
{
    bool SomeBoolean;
    cout << "Hello world!" << endl;
    if (!SomeBoolean && Layer)
    {
        cout << "Important" << endl;
    }
    return 0;
}

After loading the project, hover over the Layer declaration to see "string* Layer".
Then hover over the occurence inside the if and ruin the tooltip.


P.S. tried to reproduce this on 13.12 on windows, couldn't.
« Last Edit: September 29, 2015, 12:06:47 am by Commaster »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Variable tooltip confusion
« Reply #3 on: September 29, 2015, 12:18:21 am »
Thanks for the report, I can confirm this bug in the trunk, and can you wrote a bug report Code::Blocks / Tickets, and mention the link here? So that this bug won't lost in the forum.

Thank you!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: Variable tooltip confusion
« Reply #4 on: September 29, 2015, 12:32:54 am »
#226 -> https://sourceforge.net/p/codeblocks/tickets/226/

Might have been a little too conservative in the description.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: Variable tooltip confusion
« Reply #5 on: November 09, 2015, 10:42:39 am »
Please close and mark as fixed, most likely by r10557. (tested on r10561)
Thanks!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Variable tooltip confusion
« Reply #6 on: November 09, 2015, 01:26:04 pm »
Please close and mark as fixed, most likely by r10557. (tested on r10561)
Thanks!
Hi, Commaster, thanks for the test, and I close that ticket, indeed this is a regression, see my comments there.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.