Author Topic: Double entries in Symbols Browser  (Read 6613 times)

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Double entries in Symbols Browser
« 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Double entries in Symbols Browser
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Double entries in Symbols Browser
« Reply #2 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Double entries in Symbols Browser
« Reply #3 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Double entries in Symbols Browser
« Reply #4 on: September 24, 2008, 03:44:07 pm »
Spotted and fixed in SVN head. :D
Thanks for the report.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: Double entries in Symbols Browser
« Reply #5 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!