Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

A bug at CodeCompletion::NativeParser

<< < (2/3) > >>

Jenna:

--- Quote from: lights_joy on September 13, 2008, 03:05:39 pm ---i know this rule. the raw code equal to:
        if ((x > 0 &&
            (line.GetChar(x) == '>' && line.GetChar(x - 1) == '-')) ||
            (line.GetChar(x) == ':' && line.GetChar(x - 1) == ':'))
if x <= 0
the first judgement x > 0 will be false, so the second judgement will not be executed. now the first two condition get false, but the second operator is ||, so the third judgement will be executed.

I compile codeblock under vs2005, it fails sometimes.
so i think it's better to be
        if (x > 0 &&
            ((line.GetChar(x) == '>' && line.GetChar(x - 1) == '-') ||
            (line.GetChar(x) == ':' && line.GetChar(x - 1) == ':')))


--- End quote ---

--- Quote from: killerbot on September 13, 2008, 03:26:51 pm ---I should check my special versions of these files, but I seem to remember GCC 4.3 also complains about this CORRECTLY.

And your suggestion is also what I have come up with since the parser wants (at least that's what I think was the purpose) :
X > 0 (meaning x-1 can be 0 but  for sure not negative) and we want to check if it is : -> or ::

--- End quote ---

You are right, this seems to be a bug.
... and we should have a close look on similar constructs gcc-4.3 warns about.

MortenMacFly:

--- Quote from: jens on September 13, 2008, 04:41:22 pm ---You are right, this seems to be a bug.

--- End quote ---
Woot. I did not check the third condition but it seems right...?! :shock:


--- Quote from: jens on September 13, 2008, 04:41:22 pm ---... and we should have a close look on similar constructs gcc-4.3 warns about.

--- End quote ---
Indeed. Who's using this compiler already to compile C::B? Could anyone provide a compiler log (e.g. the one C::B produces) for the C::B project and the (contrib) plugins with the appropriate warning level enabled?

Mmmmh... Probably now it's time to install the TDragon stuff once again...

stahta01:

--- Quote from: MortenMacFly on September 14, 2008, 02:38:11 pm ---Indeed. Who's using this compiler already to compile C::B? Could anyone provide a compiler log (e.g. the one C::B produces) for the C::B project and the (contrib) plugins with the appropriate warning level enabled?

--- End quote ---

I have TDM MinGW Installed; what is the appropriate warning level?

Tim S

MortenMacFly:

--- Quote from: stahta01 on September 14, 2008, 05:10:12 pm ---I have TDM MinGW Installed; what is the appropriate warning level?

--- End quote ---
I don't really know. Just try -W and -Wall together. This should most likely include everything. ;-)

stahta01:

--- Quote from: MortenMacFly on September 14, 2008, 05:37:23 pm ---
--- Quote from: stahta01 on September 14, 2008, 05:10:12 pm ---I have TDM MinGW Installed; what is the appropriate warning level?

--- End quote ---
I don't really know. Just try -W and -Wall together. This should most likely include everything. ;-)

--- End quote ---

Ok; will do with those options.

Having to recompile wxWidgets, using 4.3.2, an ABI looking error happens.

Note: I think an wxWidgets complied with 4.3.2 can work with Code::Blocks compiled with 3.4.5.
But, wxWidgets complied with 3.4.5 does NOT work with Code::Blocks compiled with 4.3.2.

Edit: -W gave way too many warnings; removed it.

Trying with -Wall and -Wmissing-include-dirs


--- Code: ---||=== Code::Blocks, tinyXML ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\base\tinyxml\tinyxmlparser.cpp|357|warning: suggest parentheses around && within |||
||=== Code::Blocks, Squirrel ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqapi.cpp||In function 'SQRESULT sq_rawdeleteslot(SQVM*, SQInteger, SQBool)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqapi.cpp|764|warning: suggest explicit braces to avoid ambiguous 'else'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqcompiler.cpp||In member function 'void SQCompiler::ParseTableOrClass(SQInteger, SQInteger)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqcompiler.cpp|781|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqvm.cpp||In member function 'bool SQVM::IsFalse(SQObjectPtr&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\squirrel\sqvm.cpp|647|warning: suggest parentheses around && within |||
||=== Code::Blocks, Squirrel std lib ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\sqstdlib\sqstdrex.cpp||In function 'const SQChar* sqstd_rex_matchnode(SQRex*, SQRexNode*, const SQChar*, SQRexNode*)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\scripting\sqstdlib\sqstdrex.cpp|487|warning: suggest parentheses around && within |||
||=== Code::Blocks, scintilla ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\ScintillaWX.cpp||In member function 'bool ScintillaWX::HasCaretSizeChanged()':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\ScintillaWX.cpp|677|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Document.cxx||In member function 'long int Document::FindText(int, int, const char*, bool, bool, bool, bool, bool, int*)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Document.cxx|1129|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Document.cxx|1130|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Document.cxx|1145|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Document.cxx|1146|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx||In member function 'void Editor::LayoutLine(int, Surface*, ViewStyle&, LineLayout*, int)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx|2060|warning: array subscript has type 'char'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx|2063|warning: array subscript has type 'char'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx|2066|warning: array subscript has type 'char'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexFortran.cxx||In function 'void ColouriseFortranDoc(unsigned int, int, int, WordList**, Accessor&, bool)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexFortran.cxx|81|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexFortran.cxx||In function 'int classifyFoldPointFortran(const char*, const char*, char)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexFortran.cxx|242|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexInno.cxx||In function 'void FoldInnoDoc(unsigned int, int, int, WordList**, Accessor&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexInno.cxx|287|warning: suggest parentheses around arithmetic in operand of ||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexOthers.cxx||In function 'void FoldPropsDoc(unsigned int, int, int, WordList**, Accessor&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexOthers.cxx|709|warning: suggest parentheses around arithmetic in operand of ||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexPython.cxx||In function 'void ColourisePyDoc(unsigned int, int, int, WordList**, Accessor&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexPython.cxx|268|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexRuby.cxx||In function 'void ColouriseRbDoc(unsigned int, int, int, WordList**, Accessor&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexRuby.cxx|708|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexTADS3.cxx||In function 'bool IsStringTransition(int, int)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexTADS3.cxx|619|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexVerilog.cxx||In function 'void FoldNoBoxVerilogDoc(unsigned int, int, int, Accessor&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexVerilog.cxx|246|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexVerilog.cxx|256|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\LexVerilog.cxx|257|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx||In member function 'const char* RESearch::Compile(const char*, int, bool, bool)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx|309|warning: suggest explicit braces to avoid ambiguous 'else'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx||In member function 'int RESearch::PMatch(CharacterIndexer&, int, int, char*)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx|679|warning: array subscript has type 'char'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx|682|warning: array subscript has type 'char'|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\wxscintilla\src\scintilla\src\RESearch.cxx|685|warning: suggest parentheses around && within |||
||=== Code::Blocks, sdk ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\cbproject.cpp||In constructor 'cbProject::cbProject(const wxString&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\sdk\cbproject.cpp|72|warning: suggest parentheses around && within |||
||=== Code::Blocks, Debugger ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\debuggergdb\gdb_driver.cpp||In member function 'virtual void GDB_driver::ParseOutput(const wxString&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\debuggergdb\gdb_driver.cpp|788|warning: suggest parentheses around && within |||
||=== Code::Blocks, Code-completion ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\classbrowserbuilderthread.cpp||In member function 'wxTreeItemId ClassBrowserBuilderThread::AddNodeIfNotThere(wxTreeCtrl*, wxTreeItemId, const wxString&, int, CBTreeData*, bool)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\classbrowserbuilderthread.cpp|365|warning: suggest parentheses around comparison in operand of &|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\nativeparser.cpp||In member function 'unsigned int NativeParser::FindCCTokenStart(const wxString&)':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\nativeparser.cpp|1139|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\parser\parserthread.cpp||In member function 'void ParserThread::DoParse()':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\parser\parserthread.cpp|660|warning: suggest parentheses around && within |||
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp||In member function 'bool Tokenizer::SkipUnwanted()':|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp|403|warning: suggest parentheses around && within |||
||=== Code::Blocks, Projects-workspaces importer ===|
G:\SourceCode\Projects\IDEs\CodeBlocks\codeblocks\src\plugins\projectsimporter\msvcloader.cpp|686|warning: multi-line comment|
||=== Build finished: 0 errors, 34 warnings ===|

--- End code ---

Tim S

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version