News:

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

Main Menu

CPPCheck bug fix

Started by Alpha, May 12, 2012, 03:35:10 PM

Previous topic - Next topic

Alpha

I am not trying to seem pushy, but could a developer be convinced to look at Patch #3285?  It is rather embarrassing that I submitted the code with the bug in it :-[, and that it somehow passed all my testcases ???.  (The fix is rather simple, as the problem was a switched call to a string function, so it should not take much time to go through.)

oBFusCATed

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

Alpha

Quote from: oBFusCATed on May 12, 2012, 05:32:16 PM
Provide a patch with wxString::Endswith in it and I'll commit it.
New patch uploaded (and tested much more thoroughly).

In testing, I noticed that if the active build target is virtual, it may add include directories without replacing macros; this can fix it:

Index: src/plugins/contrib/CppCheck/CppCheck.cpp
===================================================================
--- src/plugins/contrib/CppCheck/CppCheck.cpp   (revision 7965)
+++ src/plugins/contrib/CppCheck/CppCheck.cpp   (working copy)
@@ -236,6 +236,8 @@
         wxString IncludeDir(IncludeDirs[Dir]);
         if (target)
             MacrosMgr->ReplaceMacros(IncludeDir, target);
+        else
+            MacrosMgr->ReplaceMacros(IncludeDir);
         IncludeList += _T("-I\"") + IncludeDir + _T("\" ");
     }
     if (target)


MortenMacFly

Quote from: Alpha on May 12, 2012, 07:27:43 PM
In testing, I noticed that if the active build target is virtual, it may add include directories without replacing macros; this can fix it:
Applied in SVN. Thanks.
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]