News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Variable tooltip confusion

Started by Commaster, September 28, 2015, 07:26:40 PM

Previous topic - Next topic

Commaster

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:
BetterwxObject* Layer = NULL;
If we hover over the "Layer", we get the proper tooltip
BetterwxObject* Layer
So far so good. And for many more occurences of this "Layer" variable.
Until, several screens lower, we stumble upon this:
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:
! SomeBoolean&& Layer

oBFusCATed

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!]

Commaster

#2
Just used the template for a console project and added the mentioned variables.
#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.

ollydbg

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.

Commaster

#226 -> https://sourceforge.net/p/codeblocks/tickets/226/

Might have been a little too conservative in the description.

Commaster

Please close and mark as fixed, most likely by r10557. (tested on r10561)
Thanks!

ollydbg

Quote from: Commaster on November 09, 2015, 10:42:39 AM
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.