News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Double entries in Symbols Browser

Started by jomeggs, September 23, 2008, 11:02:10 PM

Previous topic - Next topic

jomeggs

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

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


cpp file

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

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

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.

MortenMacFly

Quote from: killerbot on September 24, 2008, 02:05: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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

jomeggs

Quote from: MortenMacFly on September 24, 2008, 10:06:54 AM
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!