Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: jomeggs on September 23, 2008, 11:02:10 pm

Title: Double entries in Symbols Browser
Post by: jomeggs on September 23, 2008, 11:02:10 pm
The class shown below seems to confuse the Symbols Browser. The function "MyFuncError(...)" appears twice what is caused by the comment /* = NULL */ in function definition just before the closing bracket.

header file
Code
class Blah
{
 public:
    void MyFuncNormal(char* szNonSense, int* nNoDefault);
    void MyFuncError(char* szNonSense, int* nWithDefaultNull = NULL);
 private:
    bool bIsCheckedByMandrav(void){return false;};
};

cpp file
Code
void Blah::MyFuncNormal(char* szNonSense, int* nNoDefault)
{
 return;
}

/* The comment between "nWithDefaultNull" and ")"  confuses the parser: */
void Blah::MyFuncError(char* szNonSense, int* nWithDefaultNull /* = NULL */)
{
 return;
}

Not a big problem, but I've lots of these comments...

SVN 5082, WINDOWS, wx2.8.7 unicode
Title: Re: Double entries in Symbols Browser
Post by: MortenMacFly on September 24, 2008, 10:06:54 am
Nice catch... Will try to look into.

BTW: NICE (!) example. That's how bug reports should look like.
Title: Re: Double entries in Symbols Browser
Post by: killerbot on September 24, 2008, 02:05:19 pm
there are already examples of this.

even when you change the name of a function parameter, that is f(int x) in the header and f(int y) in the cpp file.
The parser does not take into account the arguments, their types, their names, and as shown here when in the header a default value is applied to an argument.

Sadly, because once this would work a lot of other things will become possible.
Title: Re: Double entries in Symbols Browser
Post by: MortenMacFly on September 24, 2008, 03:04:19 pm
there are already examples of this.
Careful! The problem here is that due to the comment the parser (actually the tokenizer) recognises the implementation arguments as:
(arg, arg, arg))
(notice the double ")") instead of:
(arg, arg, arg)
Thus is becomes an "unknown" function as it is a new signature.

What you want (truly interpret the args as a signature) won't be easily done.
Title: Re: Double entries in Symbols Browser
Post by: MortenMacFly on September 24, 2008, 03:44:07 pm
Spotted and fixed in SVN head. :D
Thanks for the report.
Title: Re: Double entries in Symbols Browser
Post by: jomeggs on September 24, 2008, 08:52:54 pm
BTW: NICE (!) example. That's how bug reports should look like.

I do my best :D and you obviously yours!!! :D :D :D

Thanks a lot for fast help!